0 votes

New to the engine and coding in general, how can i move the Camera3D Node?
i've tried

head.Transform.origin(0, 0, 0)

and

head = head.setglobaltransform(0, 0, 1.2)

the former gives an error that says it cant get transform in base camera
and second one says invalid call setglobaltransform in base camera expected 1 arguements

in Engine by (12 points)

1 Answer

+1 vote

Welcome to using Godot! You got it almost right. Transform.origin is property of the camera's transform (and all Spatial objects'). To change them, you need to set them to a new value.

head.global_transform.origin = Vector3(0, 0, 0)

If you're wondering whether you need to use transform or global_transform, it's usually safer to go with global. The difference can be seen if node's parent will move, scale or rotate.

That said, you might benefit trying making small 2D projects at first. Knowledge you'll gain will directly benefit making 3D games as well.

by (382 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.