Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…
Are you using a rift or a vive? I am using the rift and for what ever reason the forwardVector is not working. I know there must be a way to get it since it is used in RoboRecall.
UPDATE
After doing lecture 20 Parabolic Teleport Pointer everything works now. Not sure if the editor was messing up on me or what but for what ever reason everything seems to work as it should
Instead of directly setting the member variable, use (preferred):
SetMotionTrackingSource(“EControllerHand::Left”) and SetMotionTrackingSource(“EControllerHand::Right”).
or:
SetTrackingSource(EControllerHand::Left) and SetMotionTrackingSource(EControllerHand::Right).
I am having the same issue with my Oculus Rift. Instead of the ring showing up where I am pointing it tends to stay directly under the controller. I guess I will just push forward to lecture 20 to get something working!
I could be wrong about this, but there seems to be an issue when using SetTrackingMotionSource(FXRMotionControllerBase::RightHandSourceId) withUnreal 4.23.1.
I believe that RightController->AddWorldOffset() is ignored and has no effect on the component transform. Because of this, it sits at the VR root which is twice the distance from the center of the play space than it should be. (When standing in the middle, motion controllers are in front of you, but the further you move from center, the further away from you they get – its local transform is exactly double what it should be).
My solution was to add another SceneComponent called HandsRoot which contains the motion controllers, and to add the world offset to that instead. This works perfectly, but seems a bit hacky
So you’re saying that the hand controllers appear to be rooted differently to the headset? I would certainly expect the AddWorldOffset to not work. After all, this position should be continually updated by the actual location of the hand controllers.
Thanks for the response. Apologies, but I was mistaken. I think this Unreal bug was causing the odd behaviour when compiling C++ and switching back to Unreal blueprints.
When I make a change to the component passed to SetupAttachment(), compile, return to Unreal, and close/reopen/recompile the blueprint which inherits the C++ class, the component hierarchy does not update. The workaround is to close the project entirely and then reopen.
And I should also add that we must change header file like below to set Display Device Model true in editor.
UPROPERTY(VisibleAnywhere)
class UMotionControllerComponent* LeftController;
UPROPERTY(VisibleAnywhere)
class UMotionControllerComponent* RightController;
I’m not sure if anyone is still having issues with this, but I thought I would share what worked for me since the UE documentation was a bit confusing for me on this step.
In the character header file, I used: UPROPERTY(VisibleAnywhere) class UMotionControllerComponent* LVRController; UPROPERTY(VisibleAnywhere) class UMotionControllerComponent* RVRController;
And in the .cpp file, I used: LVRController = CreateDefaultSubobject<UMotionControllerComponent>(TEXT("Left VR Controller")); LVRController->SetupAttachment(VRRoot); LVRController->MotionSource = TEXT("Left");
The controllers just showed up as soon as I turned them on and moved around perfectly.
If you still can’t see it, then start the game, go to the editor, find the player’s character, go to the missing motion controller’s component, and make sure “Display Device Model” under “Visualization” is checked.