• News

• Industries

• Learning & Support

• Community

• Marketplace

# How to draw trace slightly offset of forward vector?

Going to put it out there now that the bounce property for the projectile component doesn’t behave properly for this as it bounces more for direct hits as opposed to less.

I’m attempting to make arrows deflect off surfaces when the arrow trajectory is skimming the surface of another object. Here is what I’m working on: arrow deflecting - YouTube – but there are problems. I’ve decided the best route is to run a trace at a slight offset of the arrows forward vector. See example photos…

Basically if I hit a 0 degree wall at 90 degrees I want the arrow to stick, that’s easy enough.

If I were to hit the same 0 degree wall at 10 degree angle either vertically or horizontally I want the arrow to deflect.

Let’s say the arrow hits the wall traveling forward at x 50, y 25. I want to send a trace a few degrees off of the traveling path. eg: x 70, y 45. I’m having difficulties figuring out how to do this.

Here you go.

This works if you are attempting an exact mirror of the hit but I’m trying to just offset it slightly. Ultimately I am trying to determine if my projectile is glancing the surface, not so much what direction to go afterwards.

For example:

If I face a wall and shoot it dead on, I’m hitting the wall surface at a 90 degree angle, assuming the surface will always be 0. I’m trying to determine if I’m hitting the wall at an angle below 10 degrees, which would be what you see as the red line in my photo.

The branch conditional here is true when the angle is less than 10 degrees.

I’ll research that blueprint and give it a shot. There’s a lot of nodes I’ve never seen before. Thanks.