CollisionShape
- Last UpdatedSep 24, 2026
- 5 minute read
The CollisionShape node enables you to create a multi-segment polyline collision mesh at runtime. By defining bounded areas, walls, slopes, and other custom geometries, it makes avatar interactions smoother and more consistent throughout the scene.
Platform support
This element is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Full support |
Full support |
Full support |
Full support |
|
|
|
|
|
|
CollisionShape modes
-
Wall — Generates a vertical collision plane for each segment. The two side edges (start and end) are always perpendicular to the ground, rising straight up by the value of height. Use this mode for handrails, guardrails, and vertical barriers.
-
Slope — Generates a horizontal thin-slab collision plane for each segment. The two side edges lie in the XZ plane, extending perpendicularly to the segment direction by height / 2 on each side. Use this mode for ramps and stairs that avatars walk on.
Wall mode
An image showing wall mode.

Slope mode
An image showing slope mode.

Code example
The Collision Shape node creates a multi-segment collision barrier. All segments generates a unique collision mesh at runtime. Intermediate waypoints beyond the first are saved as <patch> elements because they do not exist in the default node definition.
This is a code example for the Collision Shape node with two segments and one intermediate waypoint.
<CollisionShape name="barrierMain" positionStart="-3 0 0" positionEnd="3 0 0" segments="2" height="1.5" mode="Wall" collisionEnabled="true">
<patch name="positionWaypoint_1">0 0 1.5</patch>
</CollisionShape>
Multi-segment polyline collision mesh
The CollisionShape node supports an arbitrary number of segments. By adding waypoints along the polyline, users can model complex barrier paths that follow curves, corners, and irregular layouts, all within a single node. Up to 100 segments can be defined per Collision Shape.
Each waypoint can be translated independently in 3D space using the editor gizmo, allowing precise control over the collision geometry. Combined with the Wall and Slope modes and the height parameter, this makes it possible to create barriers of virtually any shape: straight corridors, angled guardrails, multi-level ramps, staircase outlines, and more.
You can add or remove points by right-clicking any point of the CollisionShape node. This image shows a CollisionShape with two segments and one intermediate point.

Add point
Inserts a new waypoint relative to the currently selected handle:
-
On the start point - The new point is placed before the start, extending the polyline outward.
-
On the end point - The new point is placed after the end, extending the polyline outward.
-
On an intermediate point - The new point is inserted at the midpoint between the selected point and the next one to the right.
Remove point
Removes the currently selected waypoint from the polyline. The minimum number of points is two (one segment), so the option is disabled when only start and end remain.
Position points with the selection picker
Instead of manually typing coordinates or dragging the gizmo, any point — including start, end, and intermediate ones — can be placed directly on scene geometry using the Selection Picker. This is the fastest way to align a collision barrier precisely to floors, walls, ramps, or any other surface already present in the scene.
-
Select the Collision Shape node in the editor.
-
Select the point handle you want to reposition.
-
Enable the Selection Picker tool in the toolbar.

-
Click any surface in the 3D viewport — the selected point snaps to that position on the scene geometry.

Height adjustment and rotation
Height can be adjusted directly in the viewport using the scale gizmo:
-
In Wall mode, only the Y axis is active. Dragging it increases or decreases the vertical height of the barrier.
-
In Slope mode, only the X or Z axis is active (whichever is perpendicular to the shape's average direction). Dragging it widens or narrows the horizontal slab.
Only one axis is enabled at a time. Allowing scale on multiple axes simultaneously would move the waypoint positions already placed in the scene, which would misalign the barrier.

Rotation is limited to the Y axis (yaw) only. The full rotation gizmo is not available because rotating around X or Z would tilt the collision geometry out of the intended plane, breaking the Wall/Slope shape. Yaw rotates all points around the shape's centroid, keeping the geometry intact.

Collision Shape fields
These are the fields for the CollisionShape node.
|
Parameter |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
collisionEnabled |
sbool |
Optional |
true |
When disabled, all collision meshes are removed from the scene. |
|
debugLineColor |
sVec3 |
Optional |
1 0.5 0 |
Color of the debug outline edges drawn around each segment's collision geometry. |
|
height |
sfloat |
Optional |
1.5 |
In Wall mode, sets the vertical height of the barrier above each segment's base line. In Slope mode, sets the total width of the horizontal slab. |
|
lineColor |
svec3 |
Optional |
1 0.5 0 |
Color of the semi-transparent ribbon mesh overlaid on each segment's collision geometry |
|
mode |
sstring |
Optional |
wall |
Defines geometry of the Collision Shape node. wall or slope. |
|
mwxTemplate |
sstring |
Optional |
user/collision_shape.mwx |
Collision Shape MWX template. This value should not be changed. |
|
pointsColor |
svec3 |
Optional |
1 0.5 0 |
Color of the debug start, intermediate and end points placeholders. |
|
positionEnd |
svec3 |
Optional |
0 0 0 |
Line end position. |
|
positionStart |
svec3 |
Optional |
0 0 0 |
Line start position. |
|
positionWaypoint_N |
svec3 |
Optional |
0 0 0 |
Collision Shape intermediate points position |
|
ribbonOpacity |
sfloat |
Optional |
0.5 |
Defines visible mesh transparency. |
|
segments |
sint |
Optional |
1 |
Number of Collision Shape segments. |
|
yaw |
sfloat |
Optional |
0 |
Rotates all points of the Collision Shape around the shape's centroid on the Y axis, keeping the collision geometry intact. |
