I create my SKPhysicsBody with rectangle from size, I set it to size of the node, but the collision detection does not work on good portion of the node. How do I draw the red frame around physics body?
I tried using precise collision detection, but it doesn't help. I have checked some debug library but it draws only direct descendants of the scene, and my nodes are few levels deep. Author apparently doesn't know what recursion is.
How do I draw red frame around physics body if my body is rectangle?
This works as of iOS 7.1 and in all OSX versions supporting SpriteKit.
In this example I'm using the variable mySKView to hold the SKView of the game.
Set the "showPhysics" property of your SKView to true/YES. This is usually done by adding the following line after the line "mySKView.showsFPS = true". Usually in the viewcontroller owning the SKView.
Obj-C:
mySKView.showsPhysics = YES;
Swift
mySKView.showsPhysics = true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With