Keep an actor in front of a pawn while it rotates and look up.

Hi!

I’m using Unreal Engine 5.3.2.

I have created an actor in front of my pawn with this code:

And I use the mouse to look:

The actor is a 3D Widget because this will be part of a VR game in the future. Now I’m testing it without using a HMD.

If I want to keep the actor in front of the pawn, how can I do it? Actor class doesn’t have Add Controller Yaw Input and neither Add Controller Pitch Input.

Thank you!

Hi,

edit:
As pezzott said, this is a better way to do it.
AttachActorToComponent
image

Worse answer:
You can use the menu ref variable to set the transform of the menu. Just get the menu ref after this:

and call set actor location and rotation with these two connected to it.

~~

1 Like

Attach it to the camera component.

2 Likes