Quantcast
Channel: Answers for "Collider collision processing speed"
Viewing all articles
Browse latest Browse all 4

Answer by Aaron Winterhoff

$
0
0
This requires a bit more information. Does TurnOnCollision therefore turn on the collider itself? Is the "DetectionMeshCollider" a Unity sphere collider, or a mesh that you've made? Mesh colliders are generally more intensive than one of Unity's built-in colliders (sphere,box, capsule etc). That said, if you're using a unity collider, unless you have a huge amount of enemies searching for an enemy, you should be fine. These things take place in the background of unity, and are ultra-fast physics calculations. The call OnTriggerEnter () gets called whenever something Enters the collider, and if you have a OnTriggerEnter () call, then it's going to be doing the check anyway. Long story short, Unity is faster than we are. If you look at their documentation itself, you can see that they ( point 5 ) actually refer to your exact problem. Their solution is to use Triggers, not check a distance. If you're checking a distance as well, then you're just doubling up on Unity's workload. [Unity Documentation Example][1] [1]: http://docs.unity3d.com/Documentation/ScriptReference/index.Performance_Optimization.html

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images