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

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -