I have a quite large 3D model in my scene, in the sense that it has many polygons.
With the model visible, framerate is a decent 60, but somehow, the Physics system behaves completely strange. When I deactivate the gameobject, Unity Physics behave as expected.
What on earth could this be? The 3D model is just a mesh… Can a large mesh affect the Unity Physics system??
You provide almost zero information here.
- Crazy: Not a specific thing.
- Unity Physics: DOTS Physics? PhysX 3D physics?
- Many Polygons: Polygons are 2D. You mean mesh triangle faces?
There’s a profiler which will show you exactly what is taking time. Without that, you cannot possibly reason about what the actual problem is but you are asking others which is an impossible task for anyone without information. You’re posting on physics but are you sure it’s not rendering issues? Why would physics have any work to do with a 3D model unless it has some kind of collider interacting with something? (you don’t mention this).
No, unless the mesh contains colliders. Maybe the “Generate colliders” option is enabled in the mesh import settings?
If this option is disabled, then check out the hierarchy of your mesh in the scene. Surely it has some collider somewhere (Mesh Collider, Box Collider, etc).
Another possibility is that part or all of the physics logic in your project (i.e Rigidbody.AddForce) is calculated and/or applied in Update instead of FixedUpdate in your scripts. That would make the physics highly unreliable, so variations in the frame rate (for example as result of having a big large mesh enabled) could have dramatic effects in the physics.
Thanks. I understand the info was a bit short.
In the meantime I found out what the problem was: a box collider had forgotten its size, and had been larger than the whole scene. In other words, all physics objects in the scene where inside this collider, and thus in “colliding” mode. Which made them jump all over the place (described as “crazy” in my original post).
About the definition of physics. I’m not aware of multiple system, and in Project Settings it is also just defined as “Physics” by unity…
Yes, that’d cause some problems!
You cannot see “Physics” and “Physics 2D” in the project settings? I feel sad that you don’t know about 2D physics in Unity.
Ah true, yeah… VR project… So no 2D physics for me…