Next: , Previous: , Up: General   [Contents][Index]


8.12 Snap To Surface

Component: SnapToSurface

This component allows objects to snap to colliders in your scene automatically. This is great for construction sims or other games where things are being created that need to "stick" to static geometry.

Field of SnapToSurface: LayerMask snapMask

What objects can we snap to? Make sure they are on the supplied layers, or nothing will happen!

Snap Settings

Field of SnapToSurface: SnapModes snapMode

Start is for run-time, validate is for in-editor (snaps when a value is changed)

Default value: SnapModes.Validate

Field of SnapToSurface: SurfaceDetectModes surfaceDetectMode

Should we look down, or forward?

Default value: SurfaceDetectModes.WorldY

Field of SnapToSurface: Vector3 rayOffset

Where should the origin of the ray be offset?

Default value: new Vector3(0f, 100f, 0f)

Available Messages

Message on SnapToSurface: Snap ()

Snaps the object based on the settings above

Field of SnapToSurface: LayerMask snapMask

What objects can we snap to? Make sure they are on the supplied layers, or nothing will happen!

Snap Settings

Field of SnapToSurface: SnapModes snapMode

Start is for run-time, validate is for in-editor (snaps when a value is changed)

Default value: SnapModes.Validate

Field of SnapToSurface: SurfaceDetectModes surfaceDetectMode

Should we look down, or forward?

Default value: SurfaceDetectModes.WorldY

Field of SnapToSurface: Vector3 rayOffset

Where should the origin of the ray be offset?

Default value: new Vector3(0f, 100f, 0f)

Available Messages

Message on SnapToSurface: Snap ()

Snaps the object based on the settings above


Next: , Previous: , Up: General   [Contents][Index]