Rotate direction vector to actor rotation?

Hello,
I wrote myself an actor component that simulates hover movement over WorldStatic objects.

Using LineTraceForObjects, I search for the WorldStatic object under my character, then I use the resulting Impact Normal with an offset to set my character’s new position. Now I try to update the actor’s rotation to match the input direction of the player, however, I have great problems getting this to work. This is how my current blueprint looks like:

As you can see, I use the Forward Vector of my character’s rotation because that works. However, now my character doesn’t update its facing, obviously, and I don’t know how to change it so that it does. In the picture, you can also see the direction vector to the middle bottom, this is the actual direciton vector that the player inputs and now I have to rotate this vector so it matches my character, who has a rotation around all axes. I tried RotateVector on this direction vector with my character’s rotation, but it results in a very strange behavior of my character.

If I have a direction vector, like (1.0,0,0), and I would like to transform this vector so that it matches a character’s rotation, how do I do this? To give an instance, (1.0,0,0) is the Forward Vector, however, my character is rotated and now I would like to transform this direction vector so that it is the Forward Vector of my character.

Any help is greatly appreciated!

… a key reason you are having this issue is that when an Actor is a player… it’s rotations are driven by Set Control Rotation (not Set World Rotation). Perhaps try this first of all, and see if it resolves your issue.

Thank you for your response, unfortunately using Set Control Rotation doesn’t seem to work as I think it should. Viewing the character in the inspector doesn’t show any change in rotation and setting a break point to the Set Control Rotation element shows that there is a small change in rotation, but it seems to reset afterwards. Here is what I do:

I would appreciate if you could help me again.

honestly, without drilling into quite a lot of detail on this… I’m not sure…

first, I’d check that Set Control Rotation is affecting your character’s rotation by adding some test rotations.

second, I’d check that the Impact Normal is giving you right rotation…

once you are sure those are correct, we can look at the elements of your BP between these two key points…

Thank you again for your reply. As it turns out, my pawn is not a player controller, as casting my pawn to controller fails, for some reason and thus Set Control Rotation doesn’t have any impact, will have to investigate what is going wrong there.

Additionally, the Make Vector action, as seen in my previous screenshot, being created from the input axis, also doesn’t create the proper vector. if the input is (x=0.00, y=1.00, z=0.00), then the resulting vector will be (x=0,00, y=0.00, z=0.00). Don’t know if there is some kind of weird floating point thing going on here or what else it could be.

mmmm… the first thing I’d suggest is double-checking that your player pawn (or character) and player controller are properly set up… generally, you need both working together… I’d definitely check out a video or two on this. From your above comment, there is perhaps some confusion because a pawn isn’t a player controller and vice versa

Once the casting is giving you the right pawn/controller… perhaps go through the steps above (Set Control rotation and check Impact Normal are giving your the right results)?