Hello. I am trying to create a piece of code that spawns a part in front of the player, but the direction the player is facing will cause the part to spawn at the back of the player at times. What I want to know is if there is a function or event that will execute a block of code depending on the direction a player is facing. Thank you.
✓ ANSWER ACCEPTED
Is there a Player Direction function?
1 answer
✓ Accepted answer
You just use the players Torso CFrame then just add an offset to it.
Simple Example:-
local a = Instance.new('Part', game.Workspace)
-- we use the players Torso CFrame
a.CFrame = game.Workspace.Player1.Torso.CFrame * CFrame.new(0,0,-2) -- this is the offset
I hope this helps.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Wow! This works like a charm.