I’ve a remodel which I must level one among its axes within the route of one other sport object, with out disturbing or rotating the opposite axes in any manner.
Think about the way in which your hips transfer round on a horizontal aircraft, whereas each your higher and decrease physique rotate to face the hip bone’s place, with out turning left or proper.
How do I obtain the above utilizing Unity transforms in C#?
On this picture, each T1 and T2 must face the controller anyplace it strikes with out spinning on their Up axis, which means their ahead axis should at all times stay ahead.
Whereas reviewing my query I see Billboarding as a suggestion. I’m asking how one can billboard each T1 and T2 to the controller with out turning their ahead instructions.
The issue I’m going through comes right down to the three axes. If I apply LookAt() to the controller, even when setting the x, y, or z, or each xz or xy or zy to 0, there isn’t any manner that LookAt() can level T1 in the suitable route alongside the Z and X axes whereas ignoring the Y. It’s at all times Z rotation solely or X rotation solely or undesired Y turning because the outcome. LookAt is inflicting the entrance of the physique to face away from the entrance when the controller strikes, I must lock it to face ahead, however tilt facet to facet and forwards and backwards.