i have this script that lets me spawn balls on E
Tear = game.ReplicatedStorage.tear local plr = game.Players.LocalPlayer UserInput = game:GetService("UserInputService") UserInput.InputBegan:Connect(function(input , gameProccesedevent) if input.KeyCode == Enum.KeyCode.E then local tearclone = Tear:Clone() tearclone.Parent = game.Workspace tearclone.CFrame = plr.Character.HumanoidRootPart.CFrame + plr.Character.HumanoidRootPart.CFrame.lookVector * 5 end end)
right now, the ball spawns infront of the humanoidrootpart. but i want it to spawn 5 studs away from where the player is looking. im pretty bad at inserting stuff to scripts, so a modified version of this script would be great.
If you have a rotating head, you can use the Head at a CFrame point, otherwise you can use the CurrentCamera.
tearclone.CFrame = plr.Character.HumanoidRootPart.CFrame + plr.Character.Head.CFrame.lookVector * 5
or
tearclone.CFrame = plr.Character.HumanoidRootPart.CFrame + workspace.CurrentCamera.CFrame