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

jquery - How do you format the date used in the popover widget title of FullCalendar? -

Bubble Sort Manually a Linked List in Java -

asp.net mvc - SSO between MVCForum and Umbraco7 -