Skip to main content

96 docs tagged with "tutorial"

View all tags

360 lookaround camera

Use mouse and touch to rotate the camera and look around a scene for a panoramic or first-person style viewer.

3D Gaussian Splat Statues

Present a gallery of Gaussian splat statues with custom shaders and post effects between exhibit transitions.

Advance loading screen

Customize the loading screen with project image assets so branding and splash art show while the app initializes.

Animate entities with curves

Drive entity motion with animation curves for simple scripted movement without building a full Anim State Graph.

Basic touch input

Handle touch events to drag and move on-screen objects for a minimal mobile-first interaction sample.

Billboards

Keep planes facing the camera for trees, flares, and sprites that always show their front toward the viewer.

Camera following a path

Animate a camera along a spline path through waypoints for flythroughs and guided cinematic motion.

Camera model masking

Use camera and light mask groups so specific lights and views only affect chosen models in layered scenes.

Capturing a screenshot

Render from a camera to a texture and export pixels as a PNG for captures and sharing from your app.

Create QR Code at runtime

Generate QR codes in the browser at runtime with a small library and show them in UI or on textures.

Detecting a double click

Detect double-clicks with timing logic and use them to move the camera or trigger actions on desktop browsers.

Detecting a double tap

Recognize double-tap gestures on touchscreens separately from single taps for mobile-friendly interactions.

Detecting a long press

Measure press duration on touch or mouse to fire actions after the user holds on an element long enough.

Dynamic UI Scroll View

Add and remove scroll view children at runtime to build lists and feeds with PlayCanvas screen-space UI.

Explosion Particle Effect

Layer particle emitters with camera shake to sell an explosion impact and debris burst in real time.

Fading objects in and out

Animate material opacity so individual models fade in and out without duplicating geometry or materials.

Flaming fireball

Drive a particle fireball that follows the pointer for a simple magical projectile and trail effect.

Flappy Bird

Recreate Flappy Bird-style tap flight with pipes and scoring as a compact PlayCanvas gameplay sample.

HTML/CSS - Live Updates

Edit HTML and CSS assets with live reload so HUD changes appear instantly while the scene keeps running.

HTML/CSS UI

Build layered HUDs and menus with standard HTML and CSS composited over the WebGL canvas.

Information hotspots

Place clickable hotspots in the 3D view that open info panels using raycasts and screen overlays.

Loading an asset at runtime

Load a single asset on demand so unused resources stay off the initial preload list until your script requests them.

Loading Circle UI

Implement a radial loading spinner UI with materials and animation for clear feedback while content streams in.

Loading Draco Compressed GLBs

Load Draco-compressed GLB models in PlayCanvas with the right pipeline so meshes stay small without breaking rendering.

Loading glTF GLBs

Load glTF GLB files as binary assets at runtime and add the resulting model instance to your PlayCanvas scene hierarchy.

Locking the mouse

Request pointer lock on click to capture the mouse for first-person look, hiding the cursor while movement drives the camera.

Mobile UI Safe Areas

Lay out screen UI inside notched and rounded device safe areas so controls stay clear of system bars and hardware cutouts.

Multiple Camera Layers

Combine multiple cameras and render layers to mix screen-space UI with world-space elements in one PlayCanvas scene.

Multiple Viewport Rendering

Split the canvas into separate camera viewports by adjusting each camera rectangle for picture-in-picture or split-screen views.

Multitouch input

Track every active touch point and visualize multitouch gestures by drawing lines between fingers on the screen.

Orange Room

Explore an interior archviz sample with dynamic reflections and baked HDR lightmaps for realistic lighting and materials.

Orbit camera

Implement an orbit camera with mouse and touch, including scroll-wheel zoom and pinch-to-zoom around a focal entity.

Pan Camera to Target

Smoothly move and aim the camera toward a world-space target so clicks or events frame important locations in the scene.

Pause/Play application

Pause and resume gameplay by toggling Application timeScale so physics, animations, and time-based logic freeze together.

Physics raycasting by tag

Filter physics raycast hits by entity tags so picking ignores the wrong colliders and only selects intended objects.

Physics with CCD

Enable continuous collision detection on rigidbodies so fast projectiles do not tunnel through thin colliders between steps.

Place an entity with physics

Spawn physics-enabled props at clicked world positions using raycasts against the ground so new bodies collide correctly.

Place entity without physics

Instantiate decorative entities at clicked ground positions using math and raycasts without adding rigidbody simulation.

Planar Mirror Reflection

Render planar reflections for mirrors and water by projecting the scene onto a plane with a reflective shader pass.

Planet Earth

Shade a globe with Earth textures, materials, and shaders to present a stylized planetary body in real time.

Point and click movement

Move a character or object toward clicked ground positions using screen-to-world raycasts for simple navigation.

Procedural Gradient Texture

Generate a gradient texture in code and apply it to materials instead of importing a bitmap for smooth color ramps.

Rainbow Trail with Mesh API

Build a rainbow ribbon trail by updating mesh vertices and colors with the Mesh API for dynamic GPU-driven geometry.

Raycast with Camera Viewports

Convert pointer coordinates into per-camera rays when using split viewports so picking hits the correct 3D region in each pane.

Render 3D World to UI

Render a 3D preview with a dedicated camera into UI elements such as inventory icons or character selection panels.

Resolution Scaling

Scale internal 3D resolution for performance while keeping crisp screen-space UI by separating world and overlay render paths.

Rotating Objects with Mouse

Orbit or spin an object by mapping mouse drag deltas in screen space to rotation quaternions or euler angles each frame.

Shockwave

Add a radial shockwave distortion to the framebuffer with a post-effect shader for impacts and cinematic camera pulses.

Simple shape raycasting

Cast a physics ray from the camera through the pointer to detect which entity or shape sits under the cursor.

Simple water surface

Approximate a stylized water plane with scrolling normals and fresnel-tinted materials for simple reflective surfaces.

Smooth camera movement

Ease the camera between positions and orientations each frame using vector lerp and quaternion slerp for cinematic motion.

Space Rocks!

Fork an Asteroids-style shooter template with mouse aiming, shooting, and waves of rocks to learn arcade game flow.

Static Batching

Merge static meshes into fewer draw calls with batching to cut CPU overhead while keeping non-moving geometry efficient.

Switching materials at runtime

Swap material assets on render components in code to change colors, shaders, or skins without duplicating mesh entities.

Third Person Controller

Follow a controllable character with a chase camera while handling input and physics for a basic third-person movement rig.

Tic Tac Toe

Implement a playable 3D tic-tac-toe board with turn handling, win detection, and UI feedback in a small sample game.

Timers

Extend the engine with one-shot timers that fire callbacks after delays while respecting global pause via time scale.

Tutorial: Layout Groups

Arrange buttons and panels with Layout Group and child layout rules to build responsive PlayCanvas UI flows.

Tutorial: Plasma Shader Chunk

Port a Shadertoy-style plasma effect into a material shader chunk so animated GLSL drives surface color in engine lighting.

Tutorial: Shop User Interface

Compose a shop screen with layout groups, buttons, sprites, and atlases to list items and purchase affordances cleanly.

Using events with scripts

Decouple scripts by firing and listening for custom events on entities or the application for modular gameplay messaging.

Vehicle Physics

Drive a wheeled vehicle with Ammo raycast wheels, suspension, and steering that works on desktop, mobile, and WebXR.

VHS/CRT Post Effect

Stack scanlines, roll, and color bleed in a fullscreen pass to mimic noisy VHS and curved CRT monitor presentation.

Vignette Aberration

Darken image edges with a vignette while splitting color channels for subtle chromatic aberration in a post-process pass.

Warp a Sprite with GLSL

Distort sprite UVs in a custom GLSL shader to create wavy or bulging effects without rebuilding mesh geometry each frame.

WebXR 360 Image

View an equirectangular 360 photo inside VR with WebXR so users can look around an immersive spherical backdrop.

WebXR 360 Video

Play omnidirectional video in a WebXR session so headset users can rotate freely while the clip streams around them.

WebXR AR Raycasting Shapes

Raycast against PlayCanvas meshes during an AR session so taps on virtual shapes work alongside the passthrough camera view.

WebXR AR: DOM Overlay

Combine WebXR AR with the DOM overlay API to place styled HTML/CSS UI above the camera feed without custom WebGL text.

WebXR AR: Hit Test

Cast rays into real-world geometry with the WebXR hit-test API to anchor virtual objects on detected floors and tables.

WebXR Controller/Hand Models

Load WebXR input profile meshes for controllers and hands so tracked hardware matches each vendor silhouette in VR.

WebXR Hands

Read WebXR hand-tracking joint poses and mirror finger motion in the scene for natural direct manipulation without controllers.

WebXR Hello World

Enter immersive VR from a minimal scene with a WebXR-ready camera rig and session lifecycle hooks you can extend.

WebXR Realistic Hands

Skin tracked hand joints with detailed meshes and materials so articulated fingers read clearly in immersive VR sessions.

WebXR Tracked Controllers

Follow six-DoF controllers in VR with starter code for poses, buttons, and haptics inside a PlayCanvas WebXR template.

WebXR VR Lab

Explore a maintained VR sandbox that demonstrates scalable interaction patterns and responsive layouts across XR devices.

WebXR: AR Image Tracking

Track printed reference images in AR and align 3D content to their pose using the WebXR image-tracking extension.

WebXR: Plane Detection

Subscribe to WebXR plane detection updates to visualize floor and table estimates for anchoring content to real surfaces.

World to UI Screen space

Project 3D world positions into screen-space anchors so labels and markers track moving objects on the 2D overlay.