VR tutorial: offset between Trace cursor and Meta controllers

Hi all! I am new with Unreal, and I am testing the Unreal + Cesium compatibility. I followed the tutoriel called Building a VR App, using a Meta Quest (1st generation). For this, i use Unreal Engine 5.0.3 and the Blueprint code. There are some issues in understanding the graphic code, and I experience a few issues in the tests. Here are my questions:

  1. in Step 2b (Blueprint), point 19, I don’t understand what function is used between the LineTraceHitLocation and the OffsetFromGround, and how to map the ground offset with the Z value. I tried the "Addé function, but it seems it adds the offset on whole X, Y and Z coordinates.

  2. in Step 4, while testing: I can see some kind of offset between the controller direction with my hand (right controller) and the location of the yellow sphere (trace cursor).

  3. Still while testing, I can experience an offset between the place where the yellow trace cursor was, and the location of my camera, not only above the ground, but also in the X,Y location. For instance, I point a house, and when teleporting, I’m 50m away from the house, not exactly above. Maybe the wrong “Add” from my question 1.

Hi Gvatin,

Thank you for reaching out!

  1. in Step 2b (Blueprint), point 19, I don’t understand what function is used between the LineTraceHitLocation and the OffsetFromGround, and how to map the ground offset with the Z value. I tried the "Addé function, but it seems it adds the offset on whole X, Y and Z coordinates.

You are correct that simply the “Add” function was used. The LineTraceHitLocation is fed into the A Vector, while you can right click on the B Vector and select “Split Struct Pin”, which will separate out each float value of the struct. Then you can specify the Z offset without X or Y being set. This was the approach used in this tutorial, see the gif below.

VectorAdd

The other two questions (2 and 3) you mention I believe are in relation to this issue above. Please post some more of your progress, I’ll be happy to answer any other questions you have.

-Ben