I want bullet to bounce/reflect mirroring the position they hit. I have it working… kind of. All collision faces facing a particular direction bounce the bullets off close enough to look correct. But any other facing direction of the colliders bounces incorrectly.
if (reflect)
{
RaycastHit hit;
if (Physics.Raycast(this.transform.position, Vector3.forward, out hit, 10f))
{
Vector3 incomingV = hit.normal - transform.position;
Vector3 reflectV = Vector3.Reflect(incomingV, hit.normal);
//Debug.DrawRay(hit.point, reflectV, Color.green, 10f);
Transform hitBounce = PoolManager.Pools["AMMO"].Spawn("BoltReflected");
hitBounce.position = hit.point;
hitBounce.eulerAngles = reflectV;
}
}
I have tried a few variations but it just doesn’t seem to ever work cleanly. Could someone please point out to me what I’ve gotten wrong?