0 votes

so i have a scripted lod system that let mesh disappear when you are far. i would like to know if i have to write a script to disable collision shapes also, or it doesn't matter.

Godot version godot 3.3
in Engine by (447 points)

3 Answers

+1 vote
Best answer

that heavily depends on your game.

Godot allready uses a binary tree to optimize collision tests. So a collsion calculation only occurs when objects are near echother.
My guess would be that a script wouldnt do much of a performance increase in this case.

You can check the impact of the physics on your game in the performance monitor of godot (time->physicsprocess, physics->collisionpairs etc.)

by (4,086 points)
selected by
+2 votes

I don't think if it would matter!
But I think that, if the collision shape is something like the one which we make by clicking on mesh.... then trimesh colision or somthing like that. then you should disable that. Because there it is written that "it is least accurate, slowest or lies between the two", so better if you disable that.
And in case if the collision shape is cube, sphere, capsule etc. Then no problem!

by (942 points)
+1 vote

If you disable the collision shape for a RigidBody or KinematicBody, it will pass through solid surfaces unless physics processing is disabled entirely on the RigidBody/KinematicBody in question. Therefore, you have to be careful with doing this.

That said, I think it doesn't make much of a difference most of the time, especially if you only use one collision shape per PhysicsBody.

by (12,889 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.