Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Need help shooting fireball in direction mouse is pointing at?

local remote = game.ReplicatedStorage.remote


remote.OnServerEvent:Connect(function(plr, Player)
	print("hi")
	local fireBall = game.Workspace.fireball:Clone()
	fireBall.Parent = game.Workspace
	local humr = plr.Character.HumanoidRootPart
	fireBall.CFrame = humr.CFrame
	
	local mouse = plr:GetMouse()

	fireBall.Anchored = false
	local bVelocity = Instance.new("BodyVelocity",fireBall)
	bVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	bVelocity.Velocity = humr.CFrame.lookVector * 200 -- I set velocity here
end)

This is my fireball server code and this currently fires in direction player is looking at

but I want fireball go to mouse direction

1 answer

I solved this myself, instead of making fireball shoot at mousedirection, I can rotate player to look at direction i want

This discussion is preserved as it was. New answers, comments, and votes are closed.