How do I make a part face away from the player?

Okay I am having a problem, I am making a flamethrower magic script and I do not even know how I would make the FX / Fire face away from the player… Heres what im trying to achieve:

And yes, ive already tried scripting it. Heres the script currently:

image

What am I doing wrong?

Use the HumanoidRootPart’s LookVector to advance the part in the same direction as the HumanoidRootPart

So,

clonedFX.Position = humanoidRootPart.Position + humanoidRootPart.CFrame.LookVector * 5 -- 5 studs in front

Or, you can use the HumanoidRootPart’s CFrame and multiply a CFrame with a blank rotation but with a position to advance it:

clonedFX.CFrame = humanoidRootPart.CFrame * CFrame.new(0,0,-5) -- 5 studs, might have to switch axes and +/-
1 Like

Right now, it faces up. How do I rotate it so it faces forward?

1 Like
clonedFX.CFrame = humanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0,0,math.rad(90)) -- might have to switch x/z and -/+
1 Like

Hey man, have a great day. You really saved me there. I only just started scripting a month ago. You must be a great scripter. Again, thanks.

3 Likes