Method / function related to rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By KKIILLOOUU

Hii,
I have two questions. Before that, it’s better to explain the objectiv of the questions. I have a camera wich rotates around a kinematic body and a animatedsprite3d (2d sprite).
Sprites direction works with the direction of the char movement. But if i rotate camera to the opposite side ( for example) , the sprite keep the same direction and so it doesn’t show the good animation. billboard is enabled.
I would like to add a variable to keep the rotation of sprite, but in the editor turning around the sprite Doesn’t change rotation degrees. So even if is billboard enabled, rotation degress of the sprite is Always 0? or there is a way to know it?
if it’s no the good way to make the code, tell me ^^. If it’s better to use rotation of camera as variable, i would like to know how ( the method called ).

Thx

How are you rotating your camera? Maybe you are having problems when camera rotation is above 180 or below 0.

Saitodepaula | 2020-06-09 21:21

Hi no, it’s not linked with how i rotate camera. But i had an answer. Maybe it’s not the best because there are lines for each sprite’s direction, and each value of rotation. ( for exemple between 0 and 45, 45 and 90…)

KKIILLOOUU | 2020-06-10 09:27

If you have an answer, please post here as an answer, and mark it as accepted. This way, everyone will know you solved your problem (this question is not listed as unanswered anymore, and newcomers can find the solution easily). Also, you share the knowledge you obtained with the community.

Saitodepaula | 2020-06-10 12:14