For example, if I was to fire a gun and a bullet shot out, I wouldn't use bodymovers because the bullet would "bounce" off the target before disappearing.

--Here is my script using CFrame movement to move the projectile where the mouse is pointing

Tool.FireEvent.OnServerEvent:connect(function(plr, target)
	
	Missile.Transparency = 1	
	
	local rocket = Missile:Clone()
	rocket.Parent = workspace
	local light = Instance.new("PointLight",rocket)
	light.Brightness = 20
	light.Range = 25
	light.Color = Color3.new(255,170,0)
	rocket.Transparency = 0
	rocket.CFrame = CFrame.new(Missile.Position, target)
	
	local swooshsound = Instance.new("Sound",rocket)
	swooshsound.Volume = 10
	swooshsound.Pitch = 0.5
	swooshsound.SoundId = "rbxasset://sounds/Rocket whoosh 01.wav"
	swooshsound.Looped = true
	swooshsound:Play()
	
	Hole.PointLight.Enabled = true
	wait(.1)
	Hole.PointLight.Enabled = false

	for i = 1,1000 do
		wait(0.01)
		rocket.CFrame = CFrame.new((Missile.Position - target).unit) -- fire a unit of the direction the mouse was facing.
	end	
end)

However, the bullet just drops to the ground. How can I fix this?

2 comments

0

You probably shouldn't use CFrame for projectiles, it will be REALLY choppy, unrealistic, and it'll also lag the game.

0

What should I use for moving projectiles? BodyMovers like BodyVelocity doesn't work at all because my rocket bounces off of a hit target before exploding for some reason..