- Home /
Which is faster? Raycast or trigger?
I need to check if ONLY ONE SIDE of a mesh touches any collider.
So, what would be faster?:
A raycast with hitInfo, very short distance and layermask.
A raycast without hitInfo and very short distance.
A sphere trigger with OntriggerEnter with colliderInfo.
A sphere collider with OnCollisionEnter without collisionInfo.
I read sphere triggers have very good performance...but are they faster than a simple raycast?
Setting a short distance on a raycast (compared to infinite) does give a large speed-up. Could also use a spherecast to get the same shape as the sphere trigger would have been.
Answer by azmat786n · Dec 04, 2012 at 04:43 AM
Raycast: if your character's gravity more then 15 down Raycast not work properly ...
Trigger: While your character in trigger it work good...
Raycast is batter when you are not use for gravity, raycast tell you coming things at front/back/up/down etc.. but trigger you know by the time it not work while it not collide others..
hope this is helpful.
Your answer
