There’s nothing additional I’m doing here just a minimal example so no chance of external problem, So what is causing this and how do I perfectly align the arrow?
I would print out the result of ‘Get Bone Transform’, in order to see what it actually returns. Your bone has a relative z-rotation offset of -90, but its world rotation might be still a zero vector, depending if the mesh is rotated in world space.
And I checked there is absolutely no rotation on the Skeletal Mesh or AActor placed in the world or anywhere, all rotations for all components are 0 (world and relative)
And even if the mesh was rotated it shouldn’t make a different right? since ultimately we’re getting the world rotation of the bone which i assume should take into account mesh and actor rotation
You can clearly see that the direction to the next bone is on the negative Y axis.
The arrow mesh however has its point on the positive X axis.
Now if you make their transforms align (as you did), the arrow will point to the +X while the next bone will be along -Y. If you want them to align you will have to additionally rotate the Arrow 90° along its Z axis after aligning.
Yea after some testing I reached the same conclusion but what I’m now trying to figure out now is that will it always be 90 deg along z axis?
If I was to import some other skeletal mesh will that 90 deg change to some other value? or is it a fixed 90 deg? Why isn’t the rotation same as shown in bone tree for actors placed in the world?
Yea I think it will be always the case. I haven’t worked with too many skeletons but I think it is a convention. If you are that worried you can leave that correction as a variable in your script so you can change it *if* a different skeleton is imported. (and that is a big “if”)