Line trace based on reflection (bounce)

GreasyExcretion
Sun, 18 Jan 2015 13:52:29 +0000
Rendering

I have a shoot mechanic that launches a physics ball that can bounce on the level collision (it is basically the FPS template ball). In relation to this I want to create a preview of the bounce trajectory. The idea is to use the trace to let the player know what direction the ball will bounce, before he actually launches it.

Later I will switch out the trace with a mesh (my “preview line”) and transform it using the values currently passed to the trace’s end-input. Until then I have used the trace to get the basics right.

Obviously there will be an error margin as the trace/line will not care about the physics (velocity and shape). I’m planning to accomodate for the velocity by using the charge values as criterias for the trace length etc. I will add the trace/preview to a tick event once I see that it is acceptable.

As you see in the video: - YouTube

it is not working correctly. It seems like trace #2 is being done from the mesh normal rather than the reflect vector. I guess my math is incorrect here.

My questions are:

1. Any thoughts on why this is not working?

2. Suggestions for better ways to do this? If possible.

Here is my blueprint.

23 posts - 6 participants