How to change bullet velocity depending on the orientation of another part?

I have a script that shoots bullets out of a tool, but I can’t get the bullets to shoot in the correct direction. I just want the bullet’s velocity to move the bullet in a way that reflects the orientation of the tool if that makes sense. Here’s my script;

local Bullet = Instance.new(“Part”)
Bullet.Position = Tool.Handle.Position
Bullet.Parent = game.Workspace
local BodyVelocity = Instance.new(“BodyVelocity”)
BodyVelocity.Velocity = Vector3.new(10,0,0)
BodyVelocity.Parent = Bullet

I was able to get it to work. Here’s the updated script;

	local Bullet = Instance.new("Part")
	Bullet.Position = Tool.Handle.Position
	Bullet.Parent = game.Workspace
	local BodyVelocity = Instance.new("BodyVelocity")
	BodyVelocity.Velocity = Tool.Handle.CFrame.LookVector * 10
	BodyVelocity.Parent = Bullet
4 Likes