Search code examples
iossprite-kitphysicsgame-physicsskphysicsbody

Keep node in view


I have a question:

Typically, a node will be removed from the view of its position if it exceeds the device's height.

I'm using gravity so it falls back down into the view. How would I make it so the node doesn't remove itself from the view?


Solution

  • A node does not remove itself from the view once it goes off screen. It's still there but no longer gets rendered. If it has a physics body, physics calculations are still ongoing despite being off screen.

    The only instance a node gets removed is if you remove it from parent.