Help with managing Motor6D Manpulation

This is my first time that I’m making a custom animator, btw.
It is to replace the traditional animations that I’ve used in a couple of months now since you can make good animations with a bit of math (namely sin, cos, abs, tan- you get it) instead of spending about 10 hours per animation.

I made it so the solution prints out the state yet it doesn’t do that?
By any chance you’ve made a mistake?

local ReplicatedStorage = game:GetService(“ReplicatedStorage”)
local UserInputService = game:GetService(“UserInputService”)

local player = game.Players.LocalPlayer
local remoteEvent = player:WaitForChild(“AnimationEvent”)
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild(“Humanoid”)

local currentAnimationState = “Idle”

remoteEvent.OnClientEvent:Connect(function(newAnimationState)
currentAnimationState = newAnimationState
end)

UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
local isMoving = humanoid.WalkSpeed > 0
if input.KeyCode == Enum.KeyCode.W then
remoteEvent:FireServer(isMoving and AnimationStates.Walking or AnimationStates.Idle)
print(“Walking”)
elseif input.KeyCode == Enum.KeyCode.LeftShift then
remoteEvent:FireServer(isMoving and AnimationStates.Running or AnimationStates.Idle)
print(“Running”)
end
end
end)

– Update animations based on currentAnimationState
– Implement the logic for each animation state

the remoteevent is parented to the player like the solution says.

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