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. Even stranger, it doesn’t seem to affect the location - which is the exact same value I set in the editor. I’d expect both to either work or both to not work.
The level blueprint:
Blueprint in level:
The Pawn’s location is correct and rotation (yellow) is **incorrect **after I start playing. The sequence of events is like this:
- The level 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. Edit: I realize it’s already possessed as it was correct on point 2, so it’s probably a refresh/update on the rotation happening here, for some reason
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.