Tuesday, June 9, 2015

Unreal Engine - Achieving First Person Perspective

Trying to find a solution for the First Person Perspective, which could then be used with the Oculus Rift, was tricky and involved a lot of trial and error. The UE4 documentation didn't have a direct solution to this, and after a lot of searching I couldn't find one anywhere else on the internet.

https://answers.unrealengine.com/questions/28024/onactorbeginoverlap-teleport-broken.html

https://answers.unrealengine.com/questions/27434/how-do-i-teleport-the-player-controller-to-a-new-l.html

I finally figured out that I had been referencing the player start incorrectly. I had been using the "Get Player Controller" component, but after looking at the first link "Simple way to teleport an actor", I wondered why they would be using "Get Player Pawn", and so tried it with my script and it worked! From there I just had to adjust a few variables and apply them to all the cabins.

Script




So the script simply allows you to teleport the player start character to different locations using keys set by the developer. Here I have them set as Numpad 1,2 and 3. As seen in the image, I've applied the location of the cabins as the "New Target" for teleportation.

It is a very simple script, but it took a lot of outside the box thinking to reach this solution.

0 comments:

Post a Comment