How To Make Projectile Move Towards Player

So currently I have an NPC with an ability, however whenever the npc activates the ability it only goes in front of it. I was wondering how I could make it go towards the player instead? I believe a solution would be to rotate the humanoidrootpart and make itlooks towards the player, but how would I do that>

function one(Attack)
	local Projectile = game.ReplicatedStorage.Hie.IceRock:Clone()
	local Alive = true
	Projectile.Parent = workspace
	Debris:AddItem(Projectile,2)
	Projectile.CanCollide = false
	Projectile.Anchored = true
	Projectile.Size = Vector3.new(20,25,20)
	Projectile.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,-18.5,-21) * CFrame.fromEulerAnglesXYZ(0,0,0)
	Projectile.Touched:Connect(function(hit)
		if hit.Parent:FindFirstChild("Humanoid") and hit.Parent.Name ~= NPC.Name then
			for i = 1,2 do
				wait(.05)
				Projectile.Transparency = 0.45
			end

			wait(0.05)
		end
	end)
end
1 Like

Humanoidrootpart.cframe = cframe.new(humanoidrootpart.position,target.positition)

Add the target position and this will rotate the humanoidrootpart along with the npc toward it (also fix the spelling I’m doing this from a phone so it won’t be perfect)

Also that entire thing is one line though it shows up as like 3 for me

Read the facing a part toward another part thing that should be the solution