简体   繁体   中英

SpriteKit: How to stop stack of nodes weighing down as more nodes are added?

I'm creating a game where the user stacks nodes using SKPhysicsJointLimit . This works, but the more nodes that are added to the stack, the more "weighed down" the stack gets and it becomes slower to move.

I get this behaviour is modelled after physics, but how do I make it so the stack continues moving normally and isn't weighed down?

The game engine is trying to model the physics as accurately as possible, and if the item gets heavier then being slower to move is just natural.

To counter this, you can make the stack lighter, by changing the density of the objects in the stack, via the density property of their physics bodies ( https://developer.apple.com/documentation/spritekit/skphysicsbody/1519983-density ) or you could reduce the gravity in the scene ( https://developer.apple.com/documentation/spritekit/skphysicsworld/1449623-gravity ) but this will obviously affect everything.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM