Colliders not detected when not in camera's view

Hi guys!

I’m pretty new to unity and trying to build a sports app, but I encountered a bizarre behavior and really hope someone can point me to a solution.
In my game I have a:

  • Players who have a rigidbody, and he moves with animations + MoveTowards function. I marked this player as IsKinematic (hope that is correct)
  • A ball that has a rigidbody.

Both objects have colliders.

My issue →
When I run the game from a floating camera POV (so I can see the field from above), everything works as expected (all collisions are detected, and the ball changes its position correctly based on these collisions).
However, when I run the same scene and watch the game through a player camera (floating above his head and moving with his every movement) all collisions are missing (not even printed to the logs) and the ball doesn’t behave as expected.

Re-running it (without even stopping the scene, just restarting it) and changing the main camera again (floating camera that sees all the field) makes all collisions occur.

My question → what can cause collisions to be not detected when they don’t appear in the camera’s POV ?!

Thanks a lot!

Nothing. Physics has no relationship with the camera which is purely rendering. The systems don’t interact with each other.

Create a new project, set-up two things to collide, position the camera so it’s pointing elsewhere. You’ll see they collide and report.

Likely you’re doing something in your project.

Hi @MelvMay ,

I tried what you said (although I tried it before) and nothing changed.
I position one camera to look on the opposite direction of my players and ball, and they’re moving due to the MoveTowards function on the players, but there are no collisions detected (no prints in the logs)
If i rotate the camera to loop at the players and ball, I got all the prints in the console and ball is moving as expected…

Physics doesn’t rely on what’s happening rendering wise so it’s something you’re doing here that’s making it camera dependent such as things not moving/disabled etc. All I can tell you is that they’re not related under the hood.

Hello, I encountered this exact same issue today. I’m posting just in case.
My animator had the property “Culling mode” set to “Cull update transform” this resulted in my collisions not happening when the objects where not being rendered.
I changed culling mode to “always animated” and everything was working fine again.

1 Like