Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove PhysicsBody outline in Swift/Xcode

In the game I am working on, several objects have physics bodies used for collision detection. When I run the game on my iPhone, these bodies are indicated by outlining each object with a bright green or blue line. Is there any way I can remove this? Is this only present when testing apps? I am using Swift and iOS 8.

like image 777
Tommy Avatar asked Jan 24 '26 22:01

Tommy


1 Answers

At some point you're enabling the showsPhysics property of your SKView. Should look something like this:

skView.showsPhysics = true

This property defaults to false, so removing the line of code enabling it will be enough to disable the behavior.

like image 151
Mick MacCallum Avatar answered Jan 27 '26 16:01

Mick MacCallum



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!