Yes it is perfectly possible:
- In your VR Pawn, create a boolean variable bMeasureOn to turn the measuring function on/off, I don’t think you want it on all the time. Make it True for the moment, later you could use a key to toggle it.
- From the Event Tick in your VR Pawn, check if the bMeasureOn variable is true with a branch. If it is, continue to 3.
- Do a Line Trace by Channel, starting from the current VR Camera position and along the VR Camera Forward Vector for enough units to hit the walls around (say 500 UU = 5 meters). I assume you know how to properly do a line trace.
- With a Branch, check the Return Value pin of the Line Trace by Channel output to make sure you have hit something
- If the Return Value pin is true (meaning you have hit something), use Break Hit Results to break the content of the Out Hit pin
- Extract the Impact Point → Break Vector → Take its Z coordinate
- Since the height of the floor is 0, this is the height of the impact point in cm above the floor
- Divide the Z coordinate by 100 to have the height in meters
That’s pretty much it. If you want to limit the measurement to walls, you can tag their meshes with a special tag and then use the Actor Has Tag node to check whether it is or not a wall.