Component:RaycastDriver: Difference between revisions

From Resonite Wiki
add info
add info it was missing
Line 19: Line 19:
|MaxDistance|Float| The maximum distance to raycast for.
|MaxDistance|Float| The maximum distance to raycast for.
|NoHitDistance|Float| How far to raycast shoot for in meters till reporting no hit.
|NoHitDistance|Float| How far to raycast shoot for in meters till reporting no hit.
|Filter|{{RootFieldType|SyncDelegate`1|[[Type:Func`2|Func`2]]<[[Type:ICollider|ICollider]], [[Type:Bool|Bool]]>}}|TypeAdv7=true|
|Filter|{{RootFieldType|SyncDelegate`1|[[Type:Func`2|Func`2]]<[[Type:ICollider|ICollider]], [[Type:Bool|Bool]]>}}|TypeAdv7=true| A [[Sync Delegate|sync delegate]] that takes a collider and returns a bool. if a collider returns false from this sync delegate, it is ignored when raycasting for objects.
|_positionDrive|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv8=true| The position to drive (usually the position of the slot this component is on)
|_positionDrive|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv8=true| The position to drive (usually the position of the slot this component is on)
|_rotationDrive|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv9=true| The rotation to drive (usually the rotation of the slot this component is on). aligns itself to the normal of the surface this raycast hit, or (0,0,0).
|_rotationDrive|{{RootFieldType|FieldDrive`1|[[Type:FloatQ|FloatQ]]}}|TypeAdv9=true| The rotation to drive (usually the rotation of the slot this component is on). aligns itself to the normal of the surface this raycast hit, or (0,0,0).

Revision as of 00:59, 24 October 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Raycast Driver component as seen in the Scene Inspector

Raycast driver drives the position of a slot to the position of a calculated hit point, and aligns it's rotation to the surface of that hit object.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
IgnoreHierarchy Slot a hiearchy of slots which to ignore the colliders for
FilterDistance Float ignore hit detections before this distance.
Origin Slot The slot to start the raycast from.
Offset Float3 The offset from Origin before starting the raycast.
Direction Float3 The direction in Origin's local space to shoot in.
MaxDistance Float The maximum distance to raycast for.
NoHitDistance Float How far to raycast shoot for in meters till reporting no hit.
Filter Func`2<ICollider, Bool> A sync delegate that takes a collider and returns a bool. if a collider returns false from this sync delegate, it is ignored when raycasting for objects.
_positionDrive field drive of Float3 The position to drive (usually the position of the slot this component is on)
_rotationDrive field drive of FloatQ The rotation to drive (usually the rotation of the slot this component is on). aligns itself to the normal of the surface this raycast hit, or (0,0,0).

Usage

Examples

Can be used to place objects onto a floor, or as a laser pointer, or as part of a draw on a surface pen.

Related Components