The '''RelativePositioner''' component puts the slot its attached to in a position based on the Bounding box and position of <code>Reference</code>. Optionally deleting the component on an update when the slot is positioned successfully.
<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Reference|Slot|
|Reference|Slot| The slot to Relative position to.
|ReferenceBoundsSpace|{{RootFieldType|RootSpace}}|TypeAdv1=true| The space to calculate the Bounding box of <code>Reference</code> in.
|ReferenceAnchor|Float3|
|ReferenceAnchor|Float3| How far away from the center of the <code>Reference</code>'s Bounding box based on size. (1,1,1) puts this slot at the positive corner in global space of <code>Reference</code>'s Bounding box and (0,0,0) put it at <code>Reference</code>'s center Bounding box point.
|ReferenceOffset|Float3|
|ReferenceOffset|Float3| How much to add to the slot position after Bounding box positioning.
|DestroyAfterDone|Bool|
|DestroyAfterDone|Bool| Whether to destroy this component after update and positioning was successfully done due to needed fields not being null.
|_target|{{RootFieldType|FieldDrive`1|[[Type:Float3|Float3]]}}|TypeAdv5=true| The position field of this slot to drive.
}}
}}
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Attach to a slot and provide a <code>Reference</code> in order for this component to do a valid position and optionally delete itself within that update.
Relative Positioner component as seen in the Scene Inspector
The RelativePositioner component puts the slot its attached to in a position based on the Bounding box and position of Reference. Optionally deleting the component on an update when the slot is positioned successfully.
How far away from the center of the Reference's Bounding box based on size. (1,1,1) puts this slot at the positive corner in global space of Reference's Bounding box and (0,0,0) put it at Reference's center Bounding box point.