Put part in front of a player

This way doesn’t really work:

Part.CFrame = PlayerHumanoidRootPart.CFrame + PlayerHumanoidRootPart.CFrame.LookVector * Vector3.new(0, 0, 5)

So, does anyone have better methods?
(I want the part to always be 5 studs ahead of the player, I don’t want it going inside the player when they turn.)

1 Like

make the part 5 studs ahead of the player at first then weld the part with the player i hope it work :slight_smile:

1 Like

The issue with your code is you’re taking the LookVector which by itself is a forward offset by 1, then multiplying it by a Vector3. Instead you would just multipy it by a number:

PlayerHumanoidRootPart.CFrame + PlayerHumanoidRootPart.CFrame.LookVector * 5

Alternatively you can also multiply the CFrame itself by a Vector3 offset, which does the same thing:

PlayerHumanoidRootPart.CFrame * Vector3.new(0, 0, -5)
4 Likes