Hi, I made a dive system for my game inspired by fall guys, but the animation doesnt play, I already tried it with previous chacters and it worked but with this one doesn’t work, can someone tell me why?
I made the animation priority as action
btw, is not the final rig thats why is buggy on the finger
Are you playing the animation on the client, or the server?
It should always be done on the client, as these changes will get replicated to other clients automatically.
The proper method of playing animation on the client goes as follows:
local kickAnimation = Instance.new("Animation")
kickAnimation.AnimationId = "rbxassetid://2515090838"
-- Create a new "AnimationController" and "Animator"
local animationController = Instance.new("AnimationController")
animationController.Parent = rig
local animator = Instance.new("Animator")
animator.Parent = animationController
-- Load the animation onto the animator
local kickAnimationTrack = animator:LoadAnimation(kickAnimation)
-- Play the animation track
kickAnimationTrack:Play()
yes, its on a local script, I dont have idea why, this is the script:
but I dont think that’s the problem because I already used the same script for R15 and other rigs and it works perfectly
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local DiveAnimation = Instance.new("Animation")
DiveAnimation.AnimationId = "rbxassetid://14899413910"
local HasDoubleJumped = false
local HasDashed = false
local Debounce = false
local PreviousJump = tick()
local DiveAnim = Humanoid.Animator:LoadAnimation(DiveAnimation)
local HapticService = game:GetService("HapticService")
local MyModule = require(game.ReplicatedStorage.Modules.GPRumble)
local player = game.Players.LocalPlayer
local uis = game:GetService("UserInputService")
local function Rumble()
if uis:GetGamepadConnected(Enum.UserInputType.Gamepad1, Enum.VibrationMotor.Small) then
MyModule.ControllerRumble(Enum.UserInputType.Gamepad1, Enum.VibrationMotor.Small, 0.2, .1)
end
end
UserInputService.InputBegan:Connect(function(key, GPE)
if key.KeyCode == Enum.KeyCode.E or key.KeyCode == Enum.KeyCode.ButtonX and not GPE and not Debounce then
if Humanoid:GetState() ~= Enum.HumanoidStateType.Freefall then
else
Debounce = true
DiveAnim:Play()
Humanoid.JumpHeight = 0
--Humanoid.WalkSpeed = 1
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.MaxForce = Vector3.new(0.2, 0, 0.2) * 10000
BodyVelocity.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 40
BodyVelocity.Parent = Character.HumanoidRootPart
Rumble()
for i = 1, 8 do
task.wait(.1)
BodyVelocity.Velocity *= .7
end
DiveAnim:Stop()
DiveAnim:Play()
BodyVelocity:Destroy()
Humanoid.WalkSpeed = 0
task.wait(0.05)
DiveAnim:Stop()
Humanoid.WalkSpeed = 16
Humanoid.JumpHeight = 5
Debounce = false
end
end
end)
Humanoid.StateChanged:Connect(function(Old, New)
if New == Enum.HumanoidStateType.Landed then
HasDoubleJumped = false
elseif New == Enum.HumanoidStateType.Jumping then
PreviousJump = tick()
end
end)
It looks like you are stopping the animation track, playing it again, and stopping it once more.
It should be more or less instantaneous, so it may look like it is not playing in the first place.
Could this be the issue?
Another thought is that perhaps the animation is marked as R15 when it should be marked R6.
You can configure what animation type it is when you choose a rig for animation, and when you export I believe it carries over.
Try both of these and let me know if you have any luck
It isnt the script because I already tried with a normal R15 character and it works, but remember that is a skinned mesh character, it isn’t R15 or R6, On the video you can see it, I animated from the skinned mesh character
I see…
I assume you have an AnimationController inside of the skinned mesh, right?
This may be causing interference with a new animation you are trying to play.
If you remove it and try to load the animations with the script above, does anything happen?
Maybe try just using the script above without integrating into your main code to try and isolate.
It is possible that either the skinned mesh animation is not playing, or your code is interfering, and by limiting the number of variables that could be causing issues, we can isolate and find the root cause.
So I just try removing the animation controller?
From the research I have done, others have seen success by removing the animation controller and trying the animation script again.
If that is not working, I recommend using the code above by itself to prevent any other edge cases within your main source. That way, you will know if it is your code causing the issue, or it simply won’t play even with a animation load & playback.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.