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.Head.CFrame.lookVector * 5 end end)
this is the script. now it just spawns balls in front of my head. i also have a head turning script so it spawns where i look. now i need to launch the projectile. i don't want it to fly like an anchored object moving in a straight line. i want it to launch like an unanchored object launched and has gravity. thanks.
Use the AssemblyLinearVelocity
property.
local Tear = game.ReplicatedStorage:WaitForChild("tear") local plr = game.Players.LocalPlayer local UserInputService = game:GetService("UserInputService") local speed = 5 -- YOU CAN CHANGE THIS UserInputService.InputBegan:Connect(function(input, gameProcessedEvent) if not gameProcessedEvent then -- if player is not typing if input.KeyCode == Enum.KeyCode.E then local char = plr.Character if not char or not char.Parent then -- if player's character hasn't loaded char = plr.CharacterAdded:Wait() end local tearclone = Tear:Clone() tearclone.Parent = workspace tearclone.CanCollide = true tearclone.Anchored = false tearclone.CFrame = char.Head.CFrame + char.Head.CFrame.LookVector tearclone.AssemblyLinearVelocity = tearclone.CFrame.LookVector * speed end end end)