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
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.
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: