Jump to content

Recommended Posts

I thought this would be relatively simple, but apparently the code for setting the player's current health and sanity aren't the same, so I'm looking for a little help.

inst.components.sanity:SetCurrent(100)

Anyone know for sure?

Edited by FurryEskimo
1 hour ago, FurryEskimo said:

Figured it out!  Apparently it's different from setting health, for some reason..


inst.components.sanity.current = 120

vs


inst.components.health:SetCurrentHealth(120)

 

Yeah, these functions that exist are sometimes helper wrapper functions while sometimes they're not used elsewhere.  You can find these inside the component file itself as to which functions exist for it.

Most user applications will find SetPercent or DoDelta to be useful rather than setting a fixed number, but there's nothing wrong with setting it directly.

  • Like 1

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...