Denis

Greetings.
I have an archer character.
I want to shoot an arrow in the same direction as the corresponding bone is facing.
Tell me how can I get such a direction?
Denis
  • Postovi: 3

Mario

You can use the Bone.WorldRotationX property to get the angle relative to the world x-axis. From that, you can calculate a vector via x=Math.Cos(angle) and y=Math.Sin(angle). Note that Math.Cos/Sin require the argument to be in radians, while Bone.WorldrotationX returns the angle in degrees.
Avatar
Mario

Mario
  • Postovi: 2965

Denis

Thank you very much.
Denis
  • Postovi: 3


Natrag na Unity