Animation not aligning and updating

So I am making a game where a player needs to dive into a pit, and I want to overwrite the regular falling animation with new one where you dive straight downwards. This is the script I have now:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Animate") then
		hit.Parent:WaitForChild("Animate"):WaitForChild("fall"):WaitForChild("FallAnim").AnimationId = "rbxassetid://107061698037112"
	end
end)

The script is inside an invisible part that you hit just when diving into the pit, but the problem is that you are already falling once you hit the part, and the animation won’t update the current falling one (you would keep falling in the regular roblox falling animation). I can’t really set the animation by default because it would be weird if people jumped like that in the spawn area. I tried just looping the animation once you fell (even though I want all the other animations still to play, like the idle and running animation because the game is not only falling) and then I discovered that the animation kinda auto aligned with the falling, so it would never dive straight downwards and align you to just skydive-fall, changing the animation’s orientation did not work as well.

1 Like

Do you mind showing videos of the falling animation in action?

robloxapp-20240822-2110231.wmv (1.0 MB)

Sorry that it is a download, I would not know how to upload it otherwise, this is my first post

1 Like

Btw I know updated the script so that it would play the animation when touching the green block (the transparent green block is the part that will swap the animationIds), the script used here was:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Animate") then
		local Anim = Instance.new("Animation")
		Anim.AnimationId = "rbxassetid://107061698037112"
		Anim.Parent = hit.Parent
		hit.Parent:WaitForChild("Humanoid"):LoadAnimation(Anim):Play()
	end
end)

Press this button, or copy and paste it in.
image

yeah i pressed that button, and even copy pasting will have the same effect, i think that i need to convert the video to a different type of video

yeah the video works now, just had to change the file to another type of video

1 Like

Set the AnimationPriority of the animation to anything higher then Movement

1 Like

Thank you very much, that worked!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.