Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如果 SKSpriteNode 对其 SKPhysicsBody 施加了一个脉冲,因此它现在具有动量,有没有办法让它立即停止移动?理论上应用相等和相反的脉冲可能会起作用,但我想知道是否有更简单的方法。谢谢 (:
您可以将其速度设置为零:
body.velocity = CGVectorMake(0, 0)
您可能还想将其角速度设置为零:
body.angularVelocity = 0
如果您希望它不受力和冲动的影响,请关闭dynamic:
dynamic
body.dynamic = false