Hiya
Been struggling with this for a while, and finally want to address it.
The situation is I have a top down shooter game, where I want to see bullets (even if it is a glowing pixel) fly once shot.
What I am finding tho is that often the bullet is travelling perhaps so fast it is not detecting collision with things like walls and pass straight thru. On slower objects (like a rocket maybe) it collides ok… but on fast projectiles it can sneak thru.
Does any one have code example or even idea for solving this.
Im considering doing (infact it is what I have tried now) a ray test first to find any object that it may hit as it gets closer. But I need to determine how far ahead I should cast the ray, and make sure that if in 1 frame time I would have gone past the wall, that I stop on the wall instead.
If multiple bullets are raycasting every frame, this would be pretty proc intensive too right?
Is it worth using rigidbody on bullets or just use a straight line of site ray projection to send the bullet down? (I do want it slow enuf that if I moved the bullet may miss. So direct ray to target is not exactly what I want.Or if an obstacle happens to walk infront of bullet it needs to hit it.
So, just looking for either examples, or ideas on a good solution for this.
Thanks heaps
-LW