Added a warning for the LookAt component - slot hierarchy |
add related, quote |
||
(One intermediate revision by the same user not shown) | |||
Line 7: | Line 7: | ||
|Name=Look At | |Name=Look At | ||
}} | }} | ||
{{Quote|Transform math is difficult, so I just use parents to solve my problems|[[User:989onan|989onan]]}} | |||
Look at is a component that is used to make one [[slot]] point to look at another slot via a SwingTwist interpolation. | Look at is a component that is used to make one [[slot]] point to look at another slot via a SwingTwist interpolation. | ||
Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret. | Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret. | ||
Line 29: | Line 30: | ||
== Sync Delegates == | == Sync Delegates == | ||
{{Table ComponentTriggers | {{Table ComponentTriggers | ||
|SetReferenceAxis:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| | |SetReferenceAxis:[[Type:ButtonEventHandler|ButtonEventHandler]]|[[Type:ButtonEventHandler|ButtonEventHandler]]|true| Called when the set reference axis button is touched. | ||
}} | }} | ||
Line 41: | Line 42: | ||
<!--T:5--> | <!--T:5--> | ||
== | == See Also == | ||
* [[Component:AutoLookAtUser]] | |||
</translate> | </translate> | ||
[[Category:Components{{#translation:}}|Look At]] | [[Category:Components{{#translation:}}|Look At]] | ||
[[Category:Components:Transform:Drivers{{#translation:}}|Look At]] | [[Category:Components:Transform:Drivers{{#translation:}}|Look At]] |
Latest revision as of 20:06, 28 June 2025
This article or section is a Stub. You can help the Resonite Wiki by expanding it.

Transform math is difficult, so I just use parents to solve my problems
Look at is a component that is used to make one slot point to look at another slot via a SwingTwist interpolation. Swing Twist is a concept that is too complicated to explain on this wiki, but essentially constrains the rotation on two axies when rotating to a point, locking it within a range. kind of like a turret.
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. |
Target
|
Slot | The slot to try to look at. |
TargetPoint
|
Float3 | The 3D point to look at when Target is not provided.
|
TargetPointSpace
|
direct RootSpace | The Coordinate space of TargetPoint
|
Up
|
Float3 | The up axis of this slot, usually best to keep at (0,1,0) |
RotationOffset
|
FloatQ | How much to rotate the slot by after applying the look at (quaternion multiplying) |
SwingReference
|
Float3 | The axis to apply "Swing" rotation to. |
TwistReference
|
Float3 | The axis to apply "Twist" rotation to. |
MaxSwing
|
Float | The maximum (pos/neg) amount that the slot can rotate on SwingReference
|
MaxTwist
|
Float | The maximum (pos/neg) amount that the slot can rotate on TwistReference
|
_target
|
field drive of FloatQ | The field to apply the rotation result to. |
Sync Delegates
Method Name | Method type and Arguments. | Is the method hidden? | Description |
---|---|---|---|
SetReferenceAxis:ButtonEventHandler
|
ButtonEventHandler | ✓ | Called when the set reference axis button is touched. |
Usage
Attach the component to a slot and provide a Target
or TargetPoint
to make it look at or point at a position. It is recommended to put a slot under this component's slot to apply offsets to the rotation.
Examples
This can be used to make a piston base and rod look at each other to stay connected when the piston moves. this can also be used to make a tracking system.