Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | bingbong |
From this (rather good!) tutorial
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 align_with_y(xform, new_y):
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!
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
rustyStriker | 2020-11-02 09:32