I’m trying to control what rotation and location the camera starts at during play. My pawn contains a camera and SprinArm, just as the standard examples do AFAIK.
I’m setting the ActorLocation of the pawn during the level’s BeginPlay, but right after this script has executed I notice that Unreal resets the rotation as the pawn seems to be possessed. What is strange is that the rotation is based on what I have in the editor/level; so if I rotate 90 degree inside the editor/level, then that’s the rotation I will end up when pressing play. It doesn’t seem to affect the location.
Blueprint in level:
The Pawn’s location (correct) and rotation (incorrect) after I start playing:
The Pawn’s location is correct and rotation (yellow) is incorrect after I start playing. The sequence of events is like this:
- The level’s BeginPlay code starts
- I set Actor Rotation and Actor Location on pawn. Right now the camera is looking correct in-game.
- The level’s BeginPlay finishes
- (My assumption). Unreal runs some built-in functions to possess the pawn and my previously correct rotation (but not location) is overwritten. This happens about 10ms after the BeginPlay finishes.
In this example I’ve rotated the camera inside the editor before pressing play, and that’s the rotation I then end up with in-game. My questions are:
- Why is it using the editor’s rotation?
- How can I control/change the rotation? I need to place this camera almost pixel-perfect during begin play and can’t be messing around with yaw/pitch to get where I want.
- Could it be that I’m using the Pawn wrong, that it shouldn’t update the rotation of the camera but rather the offset on the arm? Note that this game is top-down so the “Pawn” is just an invisible thing with a camera following it.