Hey guys,
I'm only a week into Playmaker and Unity so please excuse me if I'm missing something obvious.
I'm making an FPS and I would like the bullets to ricochet off the walls. My problem is that the ricochet direction is always downwards (-Y) but the Z and X seem to be correct. Eg. If I hit the wall at an upward angle I'd expect it to continue upwards. I've got a tracer on it too, and sometimes I can see the trace line wobbles after it ricochets which I have idea about either (but that's not so much a problem yet). I'm only using colliders, rigid bodies and add force to achieve this at this point, so I'm not sure if that's where the problem lies and this is harder than I thought.
This is how the sequence of events roll:
1. Mouse1 to spawn bullet object
2. Bullet uses Add Force to propel on self Z axis
3. Walls, floor and ceiling are tagged "walls" and upon Collision Enter they add 1 to a float value "ricochetCount".
4. If ricochetCount is >=1 when it hits a "wall" the bullet will destroy itself.
As far as I can tell, this all seems to be working correctly. I just can't for the life of me figure out is this problem with the upwards angle of the ricochet.
If it helps, I'm not using gravity on the bullet object, and I've put a sphere collider on it, to simplify the deflection. I've attached a screenshot.
Thanks in advance for reading this and any help you give me.