Need Help With Rotate Without Humanoid

Hi Im CTG I Need help
** I’m making tower defense game and now I’m making Non-Human Zombie **
** But Idk Why My Zombie Is Rotate Strange **

https://gyazo.com/d5ffed9b1f402e71cbd44d0733342448

Here Is The Video About How It Rotate

for waypoint=1, #waypoints:GetChildren() do
			wait(0.1)
			print(waypoint)
			local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle.Linear,Enum.EasingDirection.Out, 0, false, 0)
			mob.MovingTo.Value = waypoint
			local MobTween = TweenService:Create(mob.HumanoidRootPart, tweenInfo, {CFrame = CFrame.new(waypoints[waypoint].Position)})
			
			
			
			if mob.Humanoid.WalkSpeed <= 0 then
				repeat MobTween:Cancel()
				until mob.Humanoid.WalkSpeed > 0 
			else
				repeat MobTween:Play()
					mob.HumanoidRootPart.CFrame = CFrame.lookAt(mob.HumanoidRootPart.Position, waypoints[mob.MovingTo.Value].Position)
				until MobTween.Completed:Wait()
			end
		end
			
			mob:Destroy()
			Map.Base.Humanoid:TakeDamage(humanoid.Health)
		end)

Here Is The Script

1 Like

the auto rotate feature with a humanoid is your best bet here. the tween you are using right now just does position not rotating. a humanoid also has a MoveTo function which will be easier than using tweens. if you don’t want the name/health to show just change the ViewerType to None. using a humanoid over a tween and CFrame is much better

well ik but if use humanoid
first is fling
second is bugged
so im trying make non humanoid

also have some system i see like tds is using a way to move without humanoid already

local tweenInfo = TweenInfo.new(Time, Enum.EasingStyle.Linear,Enum.EasingDirection.Out, 0, false, 0)
for waypoint = 1, #waypoints:GetChildren() do
	mob.MovingTo.Value = waypoint
	local MobTween = TweenService:Create(mob.HumanoidRootPart, tweenInfo, {Position = waypoints[waypoint].Position})
	mob.HumanoidRootPart.CFrame = CFrame.new(mob.HumanoidRootPart.Position, waypoints[waypoint].Position)
	
	print(waypoint)
	
	MobTween:Play()
	MobTween.Completed:Wait()
end

it bugged than cframe but still thank btw

it was rotating because you was tweening cframe which is position and orientation

well it rotate right but it make another bug make npc move very wried

I found the issue.

Down below, you are changing the CFrame to the CFrame of the waypoint. (Part)

Since the part FrontFace is facing down, the HumanoidRootPart of the Zombie model is rotating to get the same Orientation has the part’s FrontFace.
To fix this, change the waypoint Orientation property to the same Orientation as the HumanoidRootPart of the Zombie.


Edit :

Don’t forget to mark this as the :white_check_mark:Solution if this fixed the problem.

could you show what exactly happends

well i found a solution by your tip but bc the tween so it make rotation not rotate right

mob.HumanoidRootPart.Rotation = waypoints[mob.MovingTo.Value].Rotation

it fling lol then back to track then fling again

did you anchor mob’s HumanoidRootPart?

yes for it not fling, bc i hate fling lol