[FIXED] - Applying opposite SetCrouching states in a frame toggles the crouch state instead of applying the last mode

Describe the bug:
npc:SetCrouch(boolean) will only toggle once per frame.
Using npc:SetCrouching(true) and npc:SetCrouching(false) in the same frame will toggle the crouch state instead of applying the last call.

How do you cause this bug?

  • List the steps
    Attach this script to an entity.
function ScriptName:OnTick()
    npc:SetCrouch(true) 
    npc:SetCrouch(false) 
    print(npc:IsCrouching())
end

console output:

[Server] true
[Server] false
[Server] true
[Server] false
[Server] true
[Server] false
...

Screenshots / video of bug:

Which platform: PC

Which input: keyboard + mouse

Your Crayta username: Daigoro

How regularly do you see this? (E.g. 2/3 times - please try 3 times if possible):
100%

Video appears to be not working on this one as well @Ya_shi_shi.

Again this seems to be pretty well written, just thought I would advise you here as well.

Hey there @Ya_shi_shi

I have submitted a ticket for this issue so that our internal team can investigate this issue further.

Not sure why all the video links broke, i am just adding a space to each post, save the changes and the videos randomly start working again :sweat_smile:

Will see if i can upload them somewhere else soon :+1:

1 Like

Hello

This should now be fixed as of 0.g1.49.126267.

Please let us know if you continue to see this issue!