Component:VirtualParent

From Resonite Wiki
Revision as of 19:04, 7 April 2024 by AmasterAmaster (talk | contribs) (Added a description for this VirtualParent component, and described the uses for it, along with a warning explaining that the virtual parent slot has to move before the slot's transform can be updated.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


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


Component image 
VirtualParent component as seen in the Scene Inspector


Description

The Virtual Parent Component is used to make a Slot act as the child of another Slot without needing to be in the normal hierarchy order. This can be useful when you need it to respond in a certain way using transforms of the overriding parent.

The Virtual Parent Component will not automatically update the slot unless the overriding parent slot has moved, rotated, or scaled (or in some way updated its current transform)

The different ways to force this Slot (that has the Virtual Parent Component on it) to update its own transform, is to move it by grabbing it, using other components to move it, or using Flux.

You can use the provided local offset fields to then further position this slot from its virtual parent.

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.
OverrideParent Slot If not null, the slot that the object gets reparented to
_targetPos field drive of Float3 Position to be driven by parent's position.
_targetRot field drive of FloatQ Rotation to be driven by parent's rotation.
_targetScl field drive of Float3 Scale to be driven by parent's scale.
LocalPosition Float3 Object's position relative to parent.
LocalRotation FloatQ Object's rotation relative to parent.
LocalScale Float3 Object's scale relative to parent.

Usage

Examples

Related Components