Disable physics debug lines on certain cameras?

Hi!

I have 2 cameras in my game, with 1 being the main camera, which can scroll, and the other 1 being the UI camera, so the UI stay in fixed position.
I also use arcade physics in my game.

Now the problem is, I need to debug the physics, but both cameras are rendering the debug lines, which makes it difficult for me to see what’s happening.
I have already put my physics objects inside a group in which the UI camera is supposed to ignore.

How can I prevent the UI camera from rendering the debug lines of my physics objects?
I only want my main camera to render them.

The debug lines are rendered in an internal Graphics object accessible through this.physics.world.debugGraphic. You can have a camera ignore it to hide the debug lines.

1 Like

Thanks! Works like a charm!