Download

VR snap turn in c++

I’ve been trying to create VR snap rotation in C++. I have tried using 2 different ways. 1.Using SetActorRotation by changing actor Yaw on key press. 2. I also tried using AddLocalRotation to achive the same result. I have noticed that a lot of people prefer to work in BPs and I was wandering if anyone has done this in C++.

I have implemented this in C++ at some point. The logic for snap rotating is the same whether you work in blueprints or C++. In the VRContentExamples project I have a snap turn example you can look at. Its all down to a function inside a blueprint function library which rotates the VRPawn around the camera. You can easily convert that function from blueprint to C++.