Hi!
I want to use 3D background (instead of parallax layers) in my 2D scene.
So I have a simple 2D scene (with player, Camera2D, platforms... etc.) and a CanvasLayer "background" that contains 3D objects (meshes, 3d camera... etc.).
When the player moves I want to change the 3D background's cam position too!
I can do this with the camera's set_translation
function.
Now in my code if the player (and the 2D camera) moves 1 pixel in 2D, then the 3D camera moves 1 unit (???) in 3D.
In this way the 3D movement is too fast.
Of course I can decrease the values (ie. 0.5), but I don't know the "right calculation formula".
I uploaded the sample project: google drive
Screenshot:

The script:
extends Sprite
func _process(delta):
var sprite2dPos = get_position();
var cam3d = get_parent().get_node("3dLayer/spatial/cam3d");
var trans3d = cam3d.get_translation();
if(Input.is_action_pressed("ui_right")):
sprite2dPos.x += 1;
trans3d.x += 1;
elif(Input.is_action_pressed("ui_left")):
sprite2dPos.x -= 1;
trans3d.x -= 1;
if(Input.is_action_pressed("ui_up")):
sprite2dPos.y -= 1;
trans3d.y += 1;
elif(Input.is_action_pressed("ui_down")):
sprite2dPos.y += 1;
trans3d.y -= 1;
set_position(sprite2dPos);
cam3d.set_translation(trans3d);
Can you help me, how to calculate the 3D camera's position correctly?
(Godot 3.2.1 standard 64bit, win10)
Thank you!