Quest 2 user in UE5: Floor level is wrongly located at half the capsule height

Good evening,

First off a bit of perspective, I am a student of the UE5 C++ course going into “crypt raider” as a massive VR enthousiast, I just couldn’t help myself wanting to make that a puzzle VR experience. I would like to be able to get the most barebones VR controller running and hence I am just following along (also for my side projects of environment design).

This has been working out perfectly so far but my HMD position seems to be added to the exact center of the character capsule no matter what. I have debugged the issue quite a bit, implementing various relative moves of “Camera” and/or its parent “VRRoot” components in C++ with respect to the capsule (using “VRRoot->SetRelativeLocation(FloorlevelCorr);”, where “FVector FloorlevelCorr{0,0,-88};”) as well as manually in the child blueprint “BP_VRCharacter” in the viewport. Both shift the camera components into the floor as is desired but on starting VR-preview (I have a player start which uses the child blueprint as default pawn class), my feet are still 88cm (half capsule height) above the floor. Also messing with the tracking origin (set to floor on BeginPlay in the blueprint) does not seem to resolve the issue as is reported in some cases. Neither does a combinations of the attempts listed above sadly, is there anything I could be missing?

Can you share a screenshot of the character blueprint you are using with the viewport showing.

I use a Quest 2 and don’t see these issues, having carried out most of the course using the UE5 preview so I’m not sure what is going on. What I did encounter was serious performance issues unless I used the VR template as the template.

1 Like

Thanks for your reply, certainly! A sidenote: the orange teleportation ring is just the recolored migrated asset from the UE4.18.3 VR project as done in the course, I did not use the Niagara system for it.

Ok, it looks like your VRRoot has an offset of -85 applied. This should be 0. The camera should be positioned around the centre of the capsule. The offset will be taken into account when the Character is spawned. Without the full blueprint, I can’t be sure of anything else but that looks like the issue. reset the Z to 0 and give it a try.

Of course, I set it to zero and noticed no effect. Which is odd actually but consistent with last night’s results.

What I could do is restart the entire course from scratch with an empty project, as you don’t have these issues and you are also using a Quest 2. A programming error seems to be the most likely scenario as I feel that none of my changes influence the final result.

If the issues persist I will follow-up on this message. If it doesn’t and I end up solving the problem I will compare the two and document the probable cause for anyone experiencing the same problem in the future. Just out of curiosity though, what is the exact moment you move the VRRoot to the floor in your own character?

1 Like

The code for this I have is the following. As far as I remember, this is never set to the floor. The code goes into the tick.

  FVector vecOffset = Camera->GetComponentLocation() - GetActorLocation();
  vecOffset.Z = 0.0f;
  AddActorWorldOffset( vecOffset );
  VRRoot->AddWorldOffset( -vecOffset );
1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms