iosswiftsprite-kitslowmotion

Slow motion with SpriteKit


I am trying to accomplish a slow motion effect in my game. So far I am using the physics world speed property

 self.physicsWorld.speed = 0.4

and it works great.

However the problem I am having is that in my scenes certain other Nodes use physics bodies to do things such as shooting with impulses. This means if my player enters slow-motion all other nodes using a physics body are also slowed down.

Can I achieve the same effect but make it apply only to my player?

I have been playing around with the speed and velocity property of the player but cannot seem to get the same effect as slowing down the physics world.

Has anyone got some suggestions please?


Solution

  • Basically there is 2 options I found.

    1) As recommended by Confused I can multiply the impulses by a factor proportionate to the slowMo value.

    2) Use SKActions