Body Velocity Bugging out

Hello i’ve been having this problem with my body velocity script for a bullet. whenever i fire the bullet instead of going where i aim it, it slowly goes up at a velocity of (0,2,0) for some reason? any idea why this would be happening? heres the code. VVV

ReplicatedStorage.RemtoteEvents.LucioFire.OnServerEvent:Connect(function(player, mouse)

		--local Bullet = ReplicatedStorage.Objects.Bullet:Clone()
		local BulletCore = ReplicatedStorage.Objects.Outer:Clone()
		BulletCore.Parent = game.Workspace.Instanced
		BulletCore.Position = player.Character.Torso.Position
	local BodyVel = Instance.new("BodyVelocity",BulletCore)
		BulletCore.Velocity = mouse.LookVector * 100
		print("Fired")
		 
		
	
end)

It’s cause you are using mouse.LookVector instead of a formula to calculate where the bullet should go.
try BodyVel.Velocity = CFrame.new(Gun position, mouse.Hit.Position).LookVector * 100

I was confused at first cuz you were talking about CFrame but now I see. Thanks this worked perfectly.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.