Humanoid.Running isn't fired at any time

Hi everyone, I’m trying to create a game with characters that can fight with eachother (FFA), so I basically started to create it and I’m facing an issue that I don’t understand

As I created the characters, I needed to create an Animate script into these characters. So I took a script and tried to understand it and recreate it by myself. Here’s the script:

-- Very basic walking animation script by GnomeCode
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")

-- Remeber to select the animtion object and set the id to your own!
local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)

local idleAnim = script:WaitForChild("Idle")
local idleAnimTrack = humanoid.Animator:LoadAnimation(idleAnim)
print("hello world - Animate Baller")
humanoid.Running:Connect(function(speed)
	print("speed is ",speed)
	if speed > 0 then
		if not walkAnimTrack.IsPlaying and idleAnimTrack.IsPlaying then
			print("walking animation now!")
			idleAnimTrack:Stop()
			walkAnimTrack:Play()
		end
	else
		if walkAnimTrack.IsPlaying and not idleAnimTrack.IsPlaying then
			print("idling animation now!")
			idleAnimTrack:Play()
			walkAnimTrack:Stop()
		end
	end
end)

idleAnimTrack:Play()

When I start my game, choose my character, there’s no animation and no errors on the console. I believe Humanoid.Running isn’t fired correctly but I’m not sure.

The solutions I tried were just making sure my animations worked well. So this is what I did: I started my game in Roblox Studio, I choosed my character and entered this command:

game.Players.AzkunOfficiel.Character.Humanoid:LoadAnimation(game.Players.AzkunOfficiel.Character.Animate.Idle):Play()

And it worked well.
Here are some screenshots:
image
image

Thanks for reading all this, hoping I’ll find an answer!

2 Likes

A local script will not play inside model, unless that model is parented to the player.Character

I think you need to try a regular server ‘script’ instead

2 Likes

I just make the script a regular one instead of a server script, but now the delay is awful…

How are you using the model to replace the default character?
What is the hierarchy?

AFAIK running is the state for both idle and walking/running states.

ServerStorage contains my characters; When the client ask for the server to change the character, the server clone the character in serverstorage and change its parent to workspace (and its name to player’s name). After this, server change player.Character to the newly cloned character in the workspace & the client change it’s current camera to the new character.

Did you try to set the network ownership of the new model to that of the player?

I solved this problem by putting an animate script inside of my starter so that it’ll run either way and work on current game.Players.LocalPlayer.Character

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