Tweening humanoid root part down does either nothing or remove the entire model

I’m making an ability for a monster where it can go under the map and pop up somewhere else, and right now I’m stuck with the going under part. For some reason, when tweening the humanoid root part of the monster, it either doesn’t move at all or the entire model is just removed out of sight.
My script: (so far)

repeat
	task.wait()
until (script.Parent):IsA("Model")
if script.Parent.Name == "Umbra Monstrum" then
	local hrp = script.Parent:WaitForChild("HumanoidRootPart")
	local ts = game:GetService("TweenService")
	local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false)
	local tween = ts:Create(hrp, tweeninfo, {CFrame = hrp.CFrame * CFrame.new(Vector3.new(0, -4, 0))}) --Changing the value from -4 to -1, -2, or -3 will leave it in its place, but -4 and -5 will make the entire model disappear from sight, even before the animation plays
	local hum = script.Parent:WaitForChild("Humanoid")
	hum.HealthChanged:Connect(function(health)
		local max = hum.MaxHealth
		if health*2 == max then
			hum.WalkSpeed = 0
			local animcontroller = hum:WaitForChild("Animator")
			local anim = hum:WaitForChild("Shadow")
			local shadowanimation = animcontroller:LoadAnimation(anim)
			shadowanimation.Priority = Enum.AnimationPriority.Action3
			shadowanimation:Play() --the animation I mentioned in the above comment, the animation does play when I don't set the Vector3 Y axis to -4 and below
			task.wait(2)
			tween:Play()
		end
	end)
	hum.Health = 3 --Test purposes only
end

Roblox doesn’t give me any errors or warnings (like prints but in yellow color) and just the things that I need to print. What’s wrong with my script? (I’m not exactly an expert)

Can’t you use Humanoid:MoveTo(place you want to go.Position) ??

I’ll try tomorrow, it’s late at night where I live

Still the same result, plus

hum.WalkSpeed = 0

It wouldn’t work anyways, I’m setting its WalkSpeed to 0 because I have another MoveTo script

You don’t need a Vector3 here.

CFrame.new(Vector3.new(0,-4,0))

You can just use this.

CFrame.new(0,-4,0)
1 Like

While I am grateful for that tip, the humanoid root part still does not move/gets removed out of sight. Is there anything wrong?

You should anchor the HumanoidRootPart before you start the tween. If you want it to continue walking afterwards, you can unanchor afterwards like so

YourHumanoidRootPart.Anchored = true

YourTweenThing:Play()
YourTweenThing.Completed:Wait()

YourHumanoidRootPart.Anchored = false

Hopefully this solves your problem.

hrp.Anchored = true
tween:Play()
tween.Completed:Wait()
hrp.Anchored = false

Thanks, but it’s still locked in place. Any other ideas?

For some reason it started working, all I did was print “yee yee” before I played the tween
Seriously, I think it also had to do with collisions and task.wait()s