I have a very basic project where I am using C++ to generate motion controllers. If I open the project where it was created in 4.21 the hand controllers track just fine and show the mesh moving with my hand controllers. As soon as I migrate to 4.22, the meshes are located on the ground at (0,0,0) essentially and do not move at all with the controllers anymore. Is there a new way to setup motion controllers that I am missing??
I don’t understand how simple things like this break so easily? Do I need to just wait for 4.22.1+? I have wasted too much time trying to get this working where I could just go back to 4.21 and continue working, but I really want to try out the new features in 4.22.
Unfortunately this does not solve the issue. I tried right after spawning the controller and attaching it to the root component, using what you said and setting that controller’s Parent to this which happens to be the Character, but then the controls not only don’t move but don’t respond to input anymore.
was same problem. It really helped me to set the owner (not parent) of the spawning controller. I don’t know how to do it in C++ but in Blueprint it looks like this
Same here. Mine even crashes the engine, not being able to even use the motion controllers altogether. This happens every time I touch the trigger button. (after migrating from 4.21 to 4.22)
My C++ code mimics this exactly. I call SetOwner on the spawned Actor that contains the motion controller and set it to the Character class and nothing works.
It is possible to fix this if you are using a source code engine. It’s pretty much just a revert of the 4.22 changes back to 4.21.
In
Source\Runtime\HeadMountedDisplay\Private\MotionControllerComponent.cpp
change this:
bool UMotionControllerComponent::PollControllerState(FVector& Position, FRotator& Orientation, float WorldToMetersScale)
{
if (IsInGameThread())
{
// Cache state from the game thread for use on the render thread
const AActor* MyOwner = GetOwner();
bHasAuthority = MyOwner->HasLocalNetOwner();
}
to this:
bool UMotionControllerComponent::PollControllerState(FVector& Position, FRotator& Orientation, float WorldToMetersScale)
{
if (IsInGameThread())
{
// Cache state from the game thread for use on the render thread
const AActor* MyOwner = GetOwner();
const APawn* MyPawn = Cast<APawn>(MyOwner);
bHasAuthority = MyPawn ? MyPawn->IsLocallyControlled() : (MyOwner->Role == ENetRole::ROLE_Authority);
}
Which is just a rollback to 4.21. No idea if it has a knock on effect, probably a risk for a networked game.
Thanks for posting this. I guess this would work for people who want to work in 4.22 still, but I will just remain in 4.21 and continue working until they post a fix.
Everyone be sure to upvote that bug ticket so this gets resolved quicker please! I’m marking this as the answer since that link should tell us when this is resolved.