Moving physical bodies - didSimulatePhysics vs update

Where is the best place to move sprites with physical bodies in Spritekit?

I know both methods are called once per frame, update first and then do SimulatePhysics before rendering the view ... What to do in the update method and what to do in didSimulatePhysics when we talk about Spritekit games?

+3


source to share


1 answer


if you are looking for physics logic like collision and contact checking on every update like endless one-way platform running game in which you have to check collision and contact with every working physical body in this case go to DidSimulatePhysics if you are searches only for moving physical bodies without contact and collision mask, then both methods are permeable.



+1


source







All Articles