#When Child Transforms Update?

1 messages · Page 1 of 1 (latest)

junior garnet
#

When Updating an objects transform, do its children also immediately get updated during that line of code Transform.Position = TargetPos?

Or are the child objects updated at the end of the frame?

stable lake
#

This would be pretty trivial to test yourself but yes, they change immediately

junior garnet
#

Are you sure this is true, Im currently running calculations based on child object positions, in the same frame the parent object is set, the calculations seem to be running on stale positions

stable lake
#

I mean you could log the positions before and after and check

edgy jasper
# junior garnet Are you sure this is true, Im currently running calculations based on child obje...

it should be before lateUpdate.. a while back I dumped whats in the engine's PlayerLoop.. in there you can see all tons of execution order.. here some of the stuff in it, cant put them all here, there are crap tons of stuffs there :

    PreLateUpdate
        AIUpdatePostScript
        DirectorUpdateAnimationBegin
        LegacyAnimationUpdate
        DirectorUpdateAnimationEnd
        DirectorDeferredEvaluate
        UpdateNetworkManager
        UpdateMasterServerInterface
        UNetUpdate
        EndGraphicsJobsLate
        ParticleSystemBeginUpdateAll
        ScriptRunBehaviourLateUpdate
        ConstraintManagerUpdate
    PostLateUpdate
        PlayerSendFrameStarted
        DirectorLateUpdate
        ScriptRunDelayedDynamicFrameRate
        PhysicsSkinnedClothBeginUpdate
        UpdateCanvasRectTransform
        PlayerUpdateCanvases
        UpdateAudio
        ParticlesLegacyUpdateAllParticleSystems
        ParticleSystemEndUpdateAll
        UpdateCustomRenderTextures

as you can see, the CanvasRectTransform update is in the the lateUpdate there, so transform should be before lateupdate

#

again, thats a cut down version, it wont fit to copy/paste without attaching as file... its massive

#

also I'm just guessing here, feel free to fact check yourself

stable lake
#

There isn't a separate process that updates child object positions. The position of an object is its local position + parent global position. If the parent's global position changes then the child's global position changes immediately

edgy jasper
#

yeah, I sorta misunderstoodthat, realized it after reading your comment, thought dude was asking the order

stable lake
junior garnet