I want my player node, a Kinematic body
to copy the position of a Position3d
node in my scene when a variable is something specific. I'm using this to move the player to a position depending on where they are coming from another scene. For example, I have 3 elevators, and I want the player to appear in a different position depending on what elevator the player entered on. Both the Position3d
and KinematicBody
nodes have a scale of 1 on each axis (1,1,1).
In order to change the position I'm doing the following:
if GlobalScript.Scene1StartingPos == "Elevator1":
$Player.global_transform = $Map/Positions/Elevator1.global_transform
If the variable Scene1StartingPos
is “Elevator1”, change the player position to the Position3d
node's position (This last node is called Elevator1).
In most cases, this works, but in some other cases, the player's scale changes automatically, even though they all have the same scale values.