Thursday, June 25, 2020

Use Vive controller to control camera in Unreal engine

We can use the first person template in unreal to use a Vive controller to control camera in Unreal engine.

create a new project, choose games>first person template

once the template opens select your FirstpersonCharacter in the world outliner, and in the "pawn" dropdown turn the check on for:

Use controller rotation Yaw
Use controller rotation Pitch
Use controller rotation Roll


Then click edit FirstPersonController up in the world outliner to open the blueprints for it


Now in the components section in the top left you need to either child the main camera to one of the motion controllers if you are ok using that camera. Or in my case create a new cinecamera. Child it to the motion controller and delete the original camera.

If you delete the original camera. When you try to run you will get 3 errors in the compile, because the new camera isn't linked. Go ahead and run, then go back to edit FirstPersonController. You will see the errors in the compioler restults just click the link where it says "target" and it will take you to the problem node.


Now just drag your cinecamera into the Target field for each of hte erroring nodes. This will relink the camera in the three places it was deleted from.

Now run the app and you should be able to control the camera using a vive controller!