How to Get Line Trace to Rotate with Actor

I have this blueprint to line trace from the bottom of the player character starting at GetActorLocation and ending at GetUpVector, but when I go to rotate the character using SetActorRotation, the line trace doesn’t rotate as well, and instead behaves the same way it would if the actor wasn’t rotated.

I attached a picture of the blueprint and the characters behaviour. What I want is for Ref 2 to have the line trace point at the ground under the player the same way it does in Ref 1 after the character is rotated to a new position.

I’m fairly inexperienced using UE4’s, so any help would be appreciated. Please only suggests solutions that can be accomplished through using blueprints.

There is a problem with the “End” parameter of the line trace function. You get the actor’s up vector, but you multiply only the Z value of the vector. GetActorUpVector (Forward and Right as well) returns a unit vector. When you multiply only the Z value of the vector, it becomes something like this, X=0.7, Y=0.3, Z=500.0 for example. You have to multiply the whole vector with the trace distance value.

286953-untitled.png

I found a solution as below. I hope it helps someone.

1 Like

Good stuff!