OK, I think I found a way to make this work with Blueprints.
I made sure that I don’t mention MotionControllerPawn or BP_MotionController in any blueprint that can potentially be accessed on the mobile device
Any interaction with VR is done via interfaces
I made a startup map where I check the type of device using GetPlatformName. Based on platform I take the player to either a VR Main Menu or mobile device menu
Only the VR player can create session - i.e. be the server. This helps me to decide which player should be spawned into MotionControllerPawn and which should be in a regular Character
I switched of the replication on MotionControllerPawn and BP_MotionController. Only relevant to owner is set to True. Net load on client set to False.
I spawn and replicate meshes that stand for VR player’s hands and head. These are visible only to clients.
This seems to work fine but if there is a better way of doing this let me know please.
I’m working on an asymmetric 2 player game that is played over LAN. One player controls a VR pawn using HTC Vive, the other plays on an Android device.
I have the networking setup and everything works fine until I reference SteamVR anywhere in any blueprint (spawning a MotionControllerPawn, casting to BP_MotionController, etc.). As soon as I do that the app on Android crashes with this error in the log:
Missing Dependency, request for SteamVRChaperoneComponent but it hasn’t been created yet
and
Error: Couldn’t find file for package /Script/SteamVR requested by async loading code. NameToLoad: /Script/SteamVR
I guess that SteamVR libraries are not being build for mobile devices which make sense but I can’t figure out how to make this work.
A bit more info:
The error is triggered by my GameMode where I spawn either a VR Pawn or a ThirdPersonCharacter after the OnPostLogin event.
What I’ve tried already:
I tried to separate blueprints that reference VR stuff from those that should run on mobile but at some point I just had to reference VR in some shared blueprints.
Eventually I tried to convert my Blueprint project to C++ so that I can force SteamVR to build for Android. I hoped that I’ll just add a line or two into the xxxxx.build.cs but I can see it’s not going to be that easy. So just out of desperation I tried to add android to the list of supported platforms in SteamVRPlugin.h. That surprisingly did not work
Any chance there is a way to fix this, any help would be greatly appreciated?