@marksatt-pitbull @devel.bmad @muchcharles @PenguinTD OK here I call for the gods.
The problem is still ownership of the MotionController Component. Each player spawn and see the other. But the MotionController Component of the client refuses to be controlled by the client pawn.
As other as highlighted in Motion controllers and networking - VR and AR Development - Unreal Engine Forums , by default the MotionController component will receive inputs from the actor who as authority over him, which in the case of my and Epic’s template is BP_MotionController.
The corresponding and relevant C++ code in the MotionControllerComponent.cpp, is:
const AActor* MyOwner = GetOwner();
const APawn* MyPawn = Cast<APawn>(MyOwner);
bHasAuthority = MyPawn ? MyPawn->IsLocallyControlled() : (MyOwner->Role == ENetRole::ROLE_Authority);
which I (and others) changed to
{
// Cache state from the game thread for use on the render thread
const AActor* MyOwner = GetOwner();
while (MyOwner && MyOwner->GetOwner() != nullptr)
{
MyOwner=MyOwner->GetOwner();
}
const APawn* MyPawn = Cast<APawn>(MyOwner);
bHasAuthority = MyPawn ? MyPawn->IsLocallyControlled() : (MyOwner->Role == ENetRole::ROLE_Authority);
}
which, by design, should go to the owner of the 2 spawned BP_MotionControllers. Sadly, it still doesn’t work
So I’m casting @mordentral and @getnamo (which I had the pleasure to met again at OC3) to bring some light. Even with a PhD I’m stuck at it, which is lame.
So here’s the build on github at https://github.com/ProteusVR/MultiplayerVR or onedrive at Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
How it works:
You should download UE4.14 source version from GitHub, and change / improve these lines of code (what I did). Then convert the project to your UE4 build.
You need 2 computers each with rift or vive, each with a different Steam account. connected to Steam
Package project
Player 1 is the listen-server. In the Main Menu you’re GREENPAWN. Launch Host. Now you’re in the lobby. Select a character (it’s all REDPAWN), and launch game (don’t select map 2 it lead to sadness and death).
Now Player 2 launch the game, select find a match, internet, and there it is.
There’s full of little things to arrange (like replication of animations etc) but I’ll do that when our main problem is resolved.
I checked in Epîc trello and 4.15 preview, nothing changed. Maybe I could raise a flag for this.
PS. @mordentral what you’re doing for VR multiplayer is fantastic and optimized. The reason why we want to have a no-plugin integration is because we work with many UE4 versions, and also tackle Hololens and we had white nights adapting yours, Rama’s and other plugins into different builts.
We Can make UE4 Great Again.