Ileana_Saphira Posted November 29, 2023 Share Posted November 29, 2023 please tell me how you can change the emotion when the character’s sanity is low Link to comment Share on other sites More sharing options...
ViridianCrown Posted January 31 Share Posted January 31 Hello. Another user, Yakuzashi, actually already answered this question a few years ago! His code was: Spoiler local assets Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber1.zip" ), Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber2.zip" ), Asset( "ANIM", "anim/NAMEOFEXPORTEDFOLDERnumber3.zip" ), Spoiler Somewhere below local assets but not inside master_postinit local function changemymind(inst) local sanity = inst.components.sanity.current if inst:HasTag("playerghost") then return end if inst.components.health:IsDead() then return end -- stage I (0-50 sanity) if sanity <= 50 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber1") end -- stage II (51-100 sainity) if sanity >= 51 and sanity <= 100 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber2") end -- stage III (over 100 sanity) if sanity >= 101 then inst.AnimState:SetBuild("NAMEOFEXPORTEDFOLDERnumber3") end end Spoiler master_posinit inst:ListenForEvent("sanitydelta", changemymind) Hope this helps! And sorry for such a late reply. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now