objective c - How to stop a sprites physicsBody from moving? -


in spritekit game move several sprites using [sprite.physicsbody applyimpulse:vector]; @ specific point game want them stop. tried apply exact opposite impulse.. did not worked well.

thanks

you can directly set physicsbody's velocity via velocity property. stop body setting it's velocity (0,0):

sprite.physicsbody.velocity = cgvectormake(0,0); 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -