Problem with projectile direction

I’m currently making a character shoot out a fireball, and everything is working except the fireball is going into the same direction every time, as shown in the video here:

		local NearestPlayer = GetNearestPlayer()
		if NearestPlayer == nil then continue end
		Model:SetPrimaryPartCFrame(, NearestPlayer.Character.PrimaryPart.Position))
		local fireballCopy = fireball:Clone()
		local spawnPoint = boss.shootfire
		local speed = 250

		fireballCopy.Position = spawnPoint.Position
		fireballCopy.Parent = game.Workspace

		fireballCopy.Velocity = fireballCopy.CFrame.LookVector * speed
1 Like

That’s because the fireball you are copying is always going to be facing the same direction. So when you are using lookVector it will always be the same as the templates direction.

To fix this is rather simple. Change the line

fireballCopy.Velocity = fireballCopy.CFrame.LookVector * speed

To use the lookVector of the primary part of the Model instead so the fireball will go in the direction the model is facing.

fireballCopy.Velocity = Model.PrimaryPart.CFrame.LookVector * speed

The fireball is 1 part right now though.


That shouldn’t impact this at all. You are just changing the direction of Velocity based off the direction the variable ‘Model’ was set to face. I am assuming that Model is equal to the boss thing that turns to face the player.


Thank you, I will test this as soon as I can.