Cant Get Custom Idle Animation Working

Currently, I am working on a 2.5D game with the idea of the Gang Beasts were you fight each other in an enclosed arena (without the traps), but instead of using your hands as weapons, you use a bow with the same sort of functionality as a bow from Terraria.

But, the problem is, I can’t seem to get any custom animation to work in my game (specifically my idle animation as its the only one I have completed). Here is one of my previous scripts that didn’t work:

local function loadAnims(character)
	local humanoid = character:WaitForChild("Humanoid")
	local animator = humanoid.WaitForChild("Animator")
	
	for _, track in pairs(animator:GetPlayingAnimationTracks()) do
		track:Stop(0)
	end
	
	local animScript = character:WaitForChild("Animate")
	animScript.idle.IdleAnim.AnimationId = "rbxassetid://15137946836"
end

local function onPlayerAdded(Player)
	Player.CharacterAppearanceLoaded:Connect(loadAnims())
end

game.Players.PlayerAdded:Connect(onPlayerAdded)
1 Like

I think you might need to clone the animate script then in the script change the idle animation in the script and in the script

or

I think the idle animations have 2 animations inside of them

1 Like

Oh alright, I’ll try that when I’m next on. I’ll tell you if it works.

1 Like

after you set the animation id of idle in the animate script, you have to change the state of the humanoid to landed.

this should work:
local humanoid = character.Humanoid
humanoid:ChangeState(Enum.HumanoidStateType.Landed)

1 Like

When I do this, it is just the normal R6 animation.

1 Like

When I do this, it fully removes all animation, as seen in the video (sorry for the bad quality, don’t know why its that bad):

robloxapp-20231023-1735547.wmv (1.3 MB)

1 Like

I was just thinking about it; could the camera script making the game only viewable from one point be tinkering with the animation? Or the script that locks the player only allowing you to move left and right? If so, here are those 2 scripts:

Locking Script:

local playerChr = script.Parent
local rootPart = playerChr.HumanoidRootPart
local plane = game.Workspace.Plane

local attachment1 = Instance.new("Attachment")
attachment1.Parent = rootPart

local planeConst = Instance.new("PlaneConstraint")
planeConst.Parent = rootPart
planeConst.Attachment0 = plane.Attachment0
planeConst.Attachment1 = attachment1

Camera Script:

local camera = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer

camera.CameraType = Enum.CameraType.Scriptable

local targetDistance = 30
local cameraDistance = -22
local cameraDirection = Vector3.new(0,0,-1.80)

local currentTarget = cameraDirection*targetDistance
local currentPosition = cameraDirection*cameraDistance

game:GetService("RunService").RenderStepped:connect(function()
	local character = player.Character
	if character and character:FindFirstChild("Humanoid") and character:FindFirstChild("HumanoidRootPart") then
		local torso = character.HumanoidRootPart
		camera.Focus = torso.CFrame
		if torso:FindFirstChild("FastStart") == nil then
			camera.CoordinateFrame = 	CFrame.new(Vector3.new(torso.Position.X, torso.Position.Y + 3, torso.Position.Z - 20) + currentPosition, 
										Vector3.new(torso.Position.X,  torso.Position.Y, torso.Position.Z - 20) + currentTarget)
		else
			
			camera.CoordinateFrame = CFrame.new(Vector3.new(torso.Position.X, torso.Position.Y - -20, torso.Position.Z - 20) + currentPosition, 
											    Vector3.new(torso.Position.X,  torso.Position.Y - -20, torso.Position.Z - 20) + currentTarget)
		end
	end
end)


1 Like

These scripts aren’t the problem. Are there any other things that could possibly be causing it not to work?

1 Like