Wonderlarr Posted July 28, 2020 Share Posted July 28, 2020 How would I get the current amount of a sanity a character has? I'm trying to implement a mechanic for when a player is below 50% sanity they can't do something specific. Link to comment https://forums.kleientertainment.com/forums/topic/120501-getting-current-sanity/ Share on other sites More sharing options...
-LukaS- Posted July 28, 2020 Share Posted July 28, 2020 inst.components.sanity:GetSanity() or inst.components.sanity:GetPercent(). I'm not currently on my pc so I'm not totally sure but you can see sanity functions in scripts/components/sanity.lua 1 Link to comment https://forums.kleientertainment.com/forums/topic/120501-getting-current-sanity/#findComment-1358067 Share on other sites More sharing options...
Wonderlarr Posted July 28, 2020 Author Share Posted July 28, 2020 1 hour ago, IThatGuyI said: inst.components.sanity:GetSanity() or inst.components.sanity:GetPercent(). I'm not currently on my pc so I'm not totally sure but you can see sanity functions in scripts/components/sanity.lua From what I can tell after looking at sanity.lua, there isn't a method for GetSanity(), however GetPercent() does exist and suffices for my uses, thank you! 1 Link to comment https://forums.kleientertainment.com/forums/topic/120501-getting-current-sanity/#findComment-1358076 Share on other sites More sharing options...
-LukaS- Posted July 28, 2020 Share Posted July 28, 2020 Yeah, I see it now. Although the current sanity can be refered to by using this: inst.components.sanity.current 2 Link to comment https://forums.kleientertainment.com/forums/topic/120501-getting-current-sanity/#findComment-1358164 Share on other sites More sharing options...
Wonderlarr Posted July 29, 2020 Author Share Posted July 29, 2020 5 hours ago, IThatGuyI said: Yeah, I see it now. Although the current sanity can be refered to by using this: inst.components.sanity.current Good to know for future reference. I wish there was an official API documentation for this stuff. Link to comment https://forums.kleientertainment.com/forums/topic/120501-getting-current-sanity/#findComment-1358248 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