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