Using Reflection Vectors on a actor

Hello my question is about using reflection vectors on an actor. My basic idea is shown this example.

I have basic code in place for this tho it’s pretty buggy atm here is that code.

And to move the actor am doing this

This is inside a looping timeline which add’s movement input to the actor. This all ends up being pretty buggy and doesn’t always working here is video showing how it currently is Sort of Working Reflection Vectors - YouTube as you can see in that video the direction doesn’t always update. So any suggestions on how I can improve this?

I’d do it with line traces. Do a trace to decide where it’s going to hit and then just lerp with a timeline ( or tick with vinterp ) from where you are to where you’re going.

The repeat the process.

It really depends how complicated it’s going to get. If there’s gonna be lots of objects hitting each other, there may be a better way…

I feel like I set this up wrong here is the end result of what I did Linetrace end result - YouTube
and here is my code
Event Graph

My Get reflection function

It basically seems to be ok ( hard to tell what the angles are in you vid ).

But the actor needs to travel to the intersection point first, then the next one etc…

Hey thanks for the help I just found a really simple solution for this. First thing I did was add a ProjectileMovement for easier movement. Next I made a c++ function that does this `float DotProduct = FVector::DotProduct(VectorToReflect, Normal);

FVector NewVector = 1 * -2 * DotProduct * Normal + VectorToReflect;

return NewVector;` Every time a bullet hits a wall this is calculates it’s reflection. All I gotta do is input the hit normal and the velocity it’s traveling at example here

And the end result is this

Anyway thanks for the help

Hello, I’m sorry to reopen this topic.I followed your tutorial to operate, but in any case, the bullet only bounces back from the opposite direction of velocity rather than reflecting like light.Can you provide more detailed functions?