Download

menu blueprint

Hello everyone,

What would be the best approach within a blueprint to constraint some 3d objects (that make part of the menu gfx) to the player camera? What I want to achieve is to have my 3d meshes to be locked to the camera like a HUD in the case I detect a HMD is connected, else they just stay at a distance (the player cannot move anyway , just look around, while the menu is on )

cheers
mrn

Take a look at this tutorial: https://www.youtube.com/watch?v=vBADl-gbITQ Now instead of just placing it into the level, you could attach it to the player

Hi,

that’s what I followed, it works for a normal game, but when I use the oculus it overrides the player settings and I can move the head around (which is good), now I just want the menu to follow the head… so you say if I apply it to the player it will automatically follow ?
Thank you

I haven’t done this myself. But i have thought about it.
I am not sure what would work best but i was thinking of just setting the transform if spawned.

Branch and check if Menu is active

every tick set transform if true.
It would make sense seeing this is how i spawn it in front of the camera.

The screenshot shows getting the camera fwd vector, location and rotation. Creating a transform from that. But i multiply to set it infront of the camera. Add that to the world location.
Note the screenshot is just to give an idea. Not the actual solution.
Your set transform should be at a tick event or something that keeps it in position.

I might be completely wrong but thats where i would start.

d55a24895b3f476b60c0f8a8163865eedb60383e.jpeg

Edit : You need to Cast to your Character. Get the Camera from your Character.
This dude did it a bit differently but it was that video that inspired me to come up with my version.
https://www.youtube.com/watch?v=CpC_1RFR7cE

Normally it should work when you attach the menu to a socket/character/mesh,… :slight_smile: → Just tried it out with a socket and now it moves with the camera

The method i used, is to create a BP for the hud, and attach it to the player character as a child actor. If you want it to stick to the camera, just drag it over the camera and adjust the location/rotation if needed. However, you better not do that as it can be pretty uncomfortable. Leaving the Hud attached to the body instead of camera allows you to give the player information about his character orientation and position