How to set a part's position forward by two studs in the direction of where it's facing

I’m trying to find how to set a part’s position forward by a couple of studs where the part is facing but I can’t find where and how to do this.

Any help is appreciated!

1 Like

You are going to want to grab the part’s LookVector.

This is a property of its CFrame, that gets the -Z Direction its facing in object space or in other words, its relative to its own facing direction

local studs = 2
local part = pathToPart
part.CFrame = part.CFrame + part.CFrame.LookVector * 2

Basically above I just use the parts CFrame then add onto it the LookVector and then i multiply that by studs

4 Likes