Moving an image in the direction it is facing

Hi there,

I’m trying to move an image based on it’s rotation.
This image will help visualize what I’m trying to explain:
(in this case, the image is the arrow)

It’s important to note that I’m moving based on scale, not offset, and the image must move to a position slightly outside the parent containers border.
The trouble I’m having is figuring out how to determine the end position of an image using the rotation.
Any help would be appreciated!

1 Like

You could use CFrame.LookVector
The LookVector is the directional vector that the CFrame is looking at.
After getting the lookvector, you can multiply it by a factor to increase or decrease the distance

Do GUI objects have LookVectors? I can’t seem to find anything on the docs about it

Oh sorry! I read your question wrong. I guess you could use trigonometry based on the angle that the object is rotated to calculate the direction.

you could maybe use the X or Z component of the GUI object’s position