+1 vote

For example what is Godot's equivalent of Unity's Vector3.up?

EDIT : No, wait, shit, I meant the equivalent of transform.up, to get the direction of a rotated object's local up vector.

in Engine by (72 points)
edited by

2 Answers

+4 votes
Best answer

The Vector3's class constants are Godot's global (world) directions. Vector3.UP, Vector3.FORWARD, Vector3.LEFT, etc.
Note that Unity's forward direction is the position Z-axis while Godot's forward direction is the negative Z-axis. The back directions are also inverted.

The local space direction of a 3D node is called Basis and it can be accessed with global_transform.basis.

  • global_transform.basis.x is the local right direction.
  • global_transform.basis.y is the local up direction.
  • global_transform.basis.z is the local back direction.
by (148 points)
selected by

Ok thank you, this is what I needed.

+1 vote

I'm not familiar with Unity at all, but according to this it's just a shorthand notation? Godot's uses very similar ones, take a look here: it's Vector3.UP.

Not sure what this has to do with "local space" though...

by (10,483 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 Frequently asked questions and 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.