How would I accomplish this?

Lets say I have an attachment called attachment1 that is pointed towards the left of the screen:

But lets say I would like to have attachment0 (You can’t see attachment0 in the images that I have shown but it’s still there) positioned somewhere along the " line " / axis that the attachment1 is pointing in.

The red dot is where I want attachment0 to be positioned at, but im not sure how I would do this.

How would I accomplish this using a script?

Change the position?

image

Thankfully, Attachments have a WorldCFrame property and with that you can get it’s LookVector.
You can multiply the LookVector by how many studs you’d like it to be in that direction.
I’d preferably set the Attachment0’s WorldPosition just so you don’t need to make a CFrame out of that LookVector.

Here’s an example:

local StudsForward = 2;
Attachment0.WorldPosition = Attachment1.WorldCFrame.LookVector * StudsForward;
2 Likes