I am trying to make a run animation that looks like the player is swimming.
The problem is that since the animation is horizontal it looks like the game is switching between vertical and horizontal. Here is a video:
Here is the video of the actual swim animation. (Don’t mind if it’s bad) .
I also have a regular run animation. How the script works is that when you spawn in your run animation is set to my running animation and when you touch a part (which is the ocean) it changes the run animation to a swimming animation and then once you stop touching the part it goes back to the regular run animation. Here is the script:
I tried searching up how to do this and watching youtube videos on how to create a running animation but nothing really worked for me.
I also have another problem which is that the same animation always plays if your holding down the key so if you go on land but keep on holding the same key it will always play swimming animation until you let go of the key.
I cannot remember if you can rotate the HumanoidRootPart in the animation editor, otherwise redo it quick. The HumanoidRootPart will rotate 90 degrees when swimming
It works, thanks for the help. I’m having another problem now though and it seems to be because of the script. The script sometimes detects that your aren’t in the water even though your are so it switches back to the running animation. Is there anyway to make it smoother. This has been shown at the bottom where it prints that it has detected my player being in the water but sometimes it isn’t. Here is a clip:
You should have somewhere in your script, where you tick swimming off/on before anything else. Then you just do the following
local Swimming = fasle -- Let this be outside your function
-- Next is inside
if Character.PrimaryPart.Position.Y < -1 and not Swimming then
Swimming = true
elseif Character.PrimaryPart.Position.Y > -0.25 and Swimming then
Swimming = false
end