ProtoFlux:SetParent
More actions
Sets the parent of Instance (Slot).
Inputs
* (Call)
Set the parent of Instance (Slot) to NewParent (Slot)
Instance (Slot)
The slot to set the parent of.
NewParent (Slot)
The slot to set the parent of Instance (Slot) to.
PreserveGlobalPosition (bool)
Whether or not to keep the values for Instance (Slot)'s local transforms or to keep it in the same place visually.
This is True by default.
Outputs
Next (Continuation)
Sends an impulse when Instance (Slot) is sucessfully parented to NewParent (Slot), or if NewParent (Slot) is null it will set it to the Root Slot of the World.
Other ways
There are two other ways to achieve a similar result:
By driving the Parent field of a slot; This allows dynamic moving of something into another hierarchy, for example adding context menu to a user's root when parented to an item.
Using ProtoFlux:Write the new parent to the Parent field of a slot; This could be more brittle and doesn't touch any of the transforms.
Examples
-
An example of the slot "Foo" setting it's parent slot set to "Bar" from "Foo2".
See Also
Category:ProtoFlux:Transform - For related notes about changing the position after parenting.