I am really unsure on how to make a deflection system where you can deflect a projectile using a weapon. For reference, I’m trying to figure out how to do a lightsaber deflection on incoming lasers like how they do in most star wars games and most recently Jedi fallen order.
The actor making the attack will be doing a line trace:
You can see on the trace results:
-
What was hit ( if anything ), the ‘actor’
-
The impact point
-
The normal of the surface and the normal at the imact point. ( That’s a ‘line’ going directly back out of the object ).
From this you can calculate the angle you will need to travel away from the actor to make it look like a rebound. It’s basically the angle between the line coming in and the normal at the point of impact, repeated on the other side of the impact.
If you are doing this with objects setup for physics, it will happen anyway. If you’re making a laser, you need to figure it out and draw the line coming back out again.
A couple of market place things come to mind:
and
Neither are mine.
Gotta up that, sorry graph and explanations are unclear for me