Problem ,Why component's Forward/Right/Up vector changed in wrong direction while actor rotated

hi iam new to blueprint , I made a simple actor to show what i met in my programe
a blank bp actor , i added two arrow and uncheck the hide in game
the two arrow name “idle” and “move” , the “idle” one has no logic ,the “move” one has a simple move forward and backward by it’s forward vector using tick event
the two arrow has invert rotation


while game start ,the two arrow should maintain “head to head” direction and move


and it work as i expect


but once the actor rotated ,the arrow behavior is changed

i dont know why that happen ,is any way to fix it?

Try using set actor location instead of set relative location or attaching the idle arrow to the move arrow. Your event tick is moving the Move arrows relative location but it is not the root and the idle arrow isn’t attached to it so it’s going to remain where it is. I think it’s only noticeable when you rotate it because that causes the movement logic to move it along the Y or Z axis.

Your get forward vector probably just grabbing the forward in world space, thus offsetting the move at an angle as the whole actor turns. If you only want to move arrow in local space, just rotate one of them by 0z and the other by 180z then just set relative loc along the x (or y) axis.

thanks for reply!
by switch to set world location it is work correctly@jay001020
seems the component’s forward vector is correct even actor is rotated ,maybe the problem is in " get relative location " node, i guess?@illspiritx cause both world & relative location use the forward vector

i know if keep the rotation aligned to X/Y/Z it could work with relative location ,but i need use it in different direction, attach to a rotated component is a solution but if i need to add bunch of component to actor is too complicated

in my project i made something like keyboard(actor) and keys(component) attach to it, use relative space can let me move the key from location A to B (as variable),and even i move&rotate actor the location A/B should remain in same place as relative , switch to world space need more calculation to get right Location A&B value.

Try something like this to get the local forward vector:

Should be able to add that to relative loc.


different direction but still wrong ,sadly
maybe i had to use world space location

I think adding to relative loc is breaking it since the relative loc always changes. Try setting start loc as a var and adding to that.

I’m using a timeline there that goes from 0 to 1 and back to 0. If using sine, remap it so it’s 0 to 1 (+1 /2).

In PiE my arrows go straight to each other like this.

Do you understand the difference between relative transforms, world transforms, and local transforms?

yes i think? although ue5 is complicate that has local/relative/abs/world transform 4 different named node
world trans == abs trans

relative trans == local

thx
in my case both arrow attach to actor root and unaligned to x/y/z ,that solution didn’t work ,if i attach “MOVE” to “IDLE” than it worked correctly.

so i assume your “Arrow1” is attached to the other arrow component? that makes it has simple rotate value

is there a way to do it without attach to a rotated component ?

my arrows are both attached to root comp. Upon further prodding, it seems the inverse transform wasn’t working as expected, and was moving arrow along actor’s forward. I didn’t notice because one arrow was already pointing forward and the other backwards.

Just moved arrows to some oddball location and rotated them by 40 and -40, then used this spaghetti to move them and it worked:

Difference is, I extracted arrow forward directly from its local rot.

Uploaded a blueprint file here: https://www.illspirit.com/files/BP_ArrowThingy.zip

Unzip to content folder in a project.

(post deleted by author)

you are my hero!!!
thank you so much

this solution do not need to save relative Loc as ref , and during actor’s rotation it still work correctly!

just like what i want
bye bye “world location” node