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

How to make projectile face direction of where it's traveling?

The script below fires an arrow from a crossbow, but the arrow doesn't face the way it's traveling. Does anyone know how to fix it?

tool = script.Parent
plr = game.Players.LocalPlayer
mouse = plr:GetMouse()

tool.Equipped:Connect(function()
	mouse.Button1Down:Connect(function()
	local p = Instance.new("Part", workspace)
	p.CanCollide = false
	p.Size = Vector3.new(1,1,1)
	p.Position = tool.Handle.Position
	tool.Mesh:Clone().Parent = p
	local bv = Instance.new("BodyVelocity", p)
	bv.Velocity = mouse.Hit.lookVector * 100
	end)
end)

1 answer

You could use lookVector once again to determine the orientation of the arrow. This method could take some experimenting. If the front of the arrow isnt actually the head, add 90 degrees on the x axis in the script.

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