0 votes

From this (rather good!) tutorial

https://www.youtube.com/watch?v=7axJJYont6Y

I need this in a 2D setting, theres a few people asking in the comments, but no ones filled in any clues....

Im guessing its changing this align function
~~~
func alignwithy(xform, newy):
xform.basis.y = new
y
xform.basis.x = -xform.basis.z.cross(new_y)
xform.basis = xform.basis.orthonormalized()
return xform
~~~
but not sure how to approach it, 'basis' is for xyz, is it transform2D to use here (for xy)? Not sure that cross product is relevant here for 2D either!!

Thanks in advance!

in Engine by (35 points)

Not sure what the problem is, but in 2D you dont have transform and basis and all that fancy stuff(since you dont need).
3D holds 3 rotational axis 3 planes and 3 movement axis, while 2D holds only 1 rotational axis, 1 plane and 2 movement axis. Thus in 2D you simply have rotation/rotation_degrees and position/global_position, you don't need to have transform and basis since you have a much simpler world to work in

1 Answer

0 votes
Best answer
by (20,677 points)
selected by

ooh! Awsome! This actually answers another (unrelated) question I had.

rustyStriker, I had gone through the docs and saw that the transform only seemed to deal with 2 axis, so was only guessing at that point, but yeah, much simpler than Im making it - as usual!

Thanks for your replies!

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.