I'm trying to set up some elastic collisions using Sprite Kit. There is an issue with the case of multiple objects resting near each other as I asked in Sprite Kit Physics Collision Issue
I am confused on the timing of the situation for a collision.
I've tried to set dynamic
to NO
in -didBeginContact:
delegate method, calculate final speeds, then in -didEndContact:
set dynamic
to YES
and then set the velocities correctly.
The reason I want it to be dynamic outside of the collision is because I want friction/gravity etc to be available. What is wrong with the order/logic? I looked at -didSimulatePhysics
method, but it didn't seem like the way to go.