I have an interpolated camera that follows a position3d, but I don't want either to move on the x axis. I would try setting the global x value to 0, but that doesn't seem possible.
Show what you tried, because setting the x value to 0 is definitely possible.
I can set the x value just fine, but it is a child of the moving player. So the value changes based on the player position. This is why I want to change the global x value to 0, but that doesn't seem to be an option.
Global position is set with global_position:
$Camera.global_position.x = 0
I tried this, but it doesn't work.
Invalid get index 'global_position' (on base: 'Position3D').
You said "Position2D' in the question.
A Spatial node's location in 3D space is set via its transform.
global_transform.origin.x = 0
Thanks, that worked!