I need a simple gun in a game I’m working on. What is faster to check collision on iOS a box collider or a raycast?
im leaning towards the box collider, raycasting works well on IOS but i’d say its slower than testing a box collider for collision.
are you sure raycasting is slower than box collider?
i can’t understand.
I’m guessing it may be because with a box collider, it just has to collide as opposed to raycasting where the raycast has to compute from start to end and checking the layers of things it hits
depends on what you want to check collision for. If for example, you want gun not to collide with walls or other objects, then box. Raycast will be straight casted line, that’s really thin, Spherecast would be something like “thick” raycast. If you are working with physics, then Raycast will be more precise, because boxes tend to jiggle, when pushed to far