Home Game Development unity – How to billboard two transforms to at least one level, protecting a ahead going through axis

unity – How to billboard two transforms to at least one level, protecting a ahead going through axis

0
unity – How to billboard two transforms to at least one level, protecting a ahead going through axis

[ad_1]

Controller is noving only on a horizontal plane. T1 and T2 needs to point towards this without changing its front face direction

Hi to the intense individuals of stackoverflow, I’m going through a selected downside in want of an answer.

I’ve a rework which I must level one in every of its axis within the path of a one other gameobject with out disturbing or rotating the opposite axises on anyway.

Consider the way in which your hips transfer round on a horizontal aircraft , whereas each your higher and decrease physique rotate to face the hip bones place with out turning left or proper.

How do I obtain the above utilizing unity transforms in C#?

In the hooked up picture, each T1 and T2 must face the controller anyplace it strikes with out spinning on its Up axis, which means its ahead axis should at all times stay ahead.

While reviewing my query I see Billboarding as a suggestion. I’m asking find out how to billboard each T1 and T2 to the controller with out turning its ahead.

Edit: The downside 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 appropriate path alongside the Z and X axes whereas ignoring the Y. It is at all times Z rotation solely or X rotation solely or undesired Y turning because the end result. 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 aspect to aspect and forwards and backwards.

In the second picture, see how the waist is transferring, each the higher and decrease physique are pointing to the waist, I’m making an attempt to perform that with rotations.

See the waist

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here