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

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -