Disregard, not a bug

When hooking up an Event to Hum.StateChanged the argument passed to the function is the state before the change.

for example, using this code:

local hum = script.Parent
local eve = hum.StateChanged:connect(function(state)
	print("argument")
	print(state)
	print("method")
	print(script.Parent:GetState())
end)

when I tick the PlatformStand value of hum, this function prints: Enum.HumanoidStateType.Running for the argument and prints Enum.HumanoidStateType.PlatformStanding for the method.

Then if I untick PlatformStand then it will print: Enum.HumanoidStateType.PlatformStanding for the argument and prints Enum.HumanoidStateType.Running for the method.

reproduce: insert a script with the above code into a Humanoid Object and tick PlatformStand value on the humanoid.

Is this intended? or is it a bug?

I’m pretty sure StateChanged gives the old state and the new state:

hum.StateChanged:connect(function(old, new)
print(old, new)
end)

well, it’s what I get for not looking at the wiki first :confused:

tbh it should be new first followed by old, to stick with the flow of .Changed events.