Shooter - Raycast Testing 1
So I've got something a bit new for you guys, the buggy is actually coming along well now I dug through this thread I was reading and found more up to date code for the anti-roll bar stuff but I thought I might try something different for awhile and focus again on the actual shooter mechanics. I may also have a rethink of the whole design of my vehicle as it turns out that the height of your mesh is also calculated when stopping your vehicle from rolling over so what that means in English is that the code seems to think I'm sort of high unstable vehicle because of that turret and roof I have I believe so I'm going to test out another design and see if that makes a difference to handling and so on.
I had only gotten a very basic single raycast going with my previous attempt at shooting so I went through a nice bullet spread tutorial I'll link you if any of you are interested at looking at that sort of thing.
It works great, as you can see in the video I demonstrate with a really basic dirt particle effect that spews stuff out when you hit something there's correct bullet spread now and I can hold down the mouse button and it will act like a proper automatic weapon and the 'bullets' which you can't see just yet will fly everywhere.
Now this is where I ran into a problem though, I'm trying to get tracers set up, these will be particles and as you can see I've only been able to get them onto the hit.point. What I want is for the bullet tracers to not only go from the gun barrel to the point that the player is aiming at I want it to match the bullet spread that I've made.
So what I'm having to do is i'm exploring my options and I think I'm going to have to ask around on the unity forums about this and it's not as straight forward as I thought it would be. Normally when moving between two points, one would use either Lerp, or alternatively MoveTowards. neither option seems to be working with how I implemented this however and that's frustrating but I'll just need to do my research as you always need to do with programming.
The good news is though, you'll see that the raycasting works fantastically with the unity destruction asset I bought, money well spent! I'll be able to have all sorts of fun creating chaos with that once I solver the bullet tracer problem.