- Изменено
Bone Direction
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?
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.
Thank you very much.