Component:LookAtUser

From Resonite Wiki
This page contains changes which are not marked for translation.
Component image 
LookAtUser component as seen in the Scene Inspector

The LookAtUser component drives the rotation specified by _rotationDrive to point towards the user specified in TargetUser, or the Local User if TargetAtLocalUser is checked.

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. Some components stop their functionality when this field is disabled, but some don't.
TargetUser User The user to look at, unless TargetAtLocalUser is checked.
TargetAtLocalUser Bool Targets the Local User in each client.
SourcePositionOffset Float3 Offset from which to calculate the look vector.
Invert Bool The rotated item faces away from the user, instead of towards.
RotationOffset FloatQ The degree to which the item is rotated away from the look vector.
PositionSource LookAtUser.UserNode The UserNode to calculate the look vector from
AroundAxis Bool The rotation is around an arbitrary axis defined in Axis.
Axis Float3 A unit vector specifying the arbitrary axis to rotate around
_rotationDrive field drive of FloatQ Automatically Assigned - The FloatQ to be driven by this component.

UserNode

Values
Name Value Description
Root 0 Component orients to look at the user's root node (Usually user slot)
Head 1 Component orients to look at the user's head node (Usually the top of the neck where the head bends.
View 2 Component orients to look at the user's view point (camera view) only works in local, else will look at the local user regardless of other settings. This may be a bug.

Usage

Attach to a slot, and then specify fields. Sometimes the fields like rotation offset and around axis may not adjust orientation as desired. In most cases, simply adding a slot beside the object that should look at another object (EX a piston that is already oriented to look at its target at rest) and then parenting it will achieve the desired effect.

Examples

Piston constraints (primagen/cyborgs), UI elements, Turrets, limb constraints, and mechanical machines/parts.

See Also