Limits the value of the variable HP with another variable

Hi, I’m trying to limit the Health variable in advance with another Max Health variable. I declared Max Health in saveagam BP class called SG. I also have an HP pickup and when I collect it I can have over 100% (100hp). I could use clamp node in Health pickup but I don’t know how to add max_health variable from SG BP class. It is possible to determited max health in event graph form SG or shop?

You can get the default variable values with the Get Class Defaults. Select your SG class to retrieve your variables.

321151-def.png

Thanks a lot for that. Do you have any idea why this isn’t working for me? When I have limited my health to maximum health, I cannot choose medkits. I do similar things for stamina, and that’s how it works!

It looks to me like your changing the max health you want to buy but your getting defaults when comparing max heath that wont be what you have change the max health to.
I would tend to just have a MaxHealth Var in your main actor then change that as needed means you only have to cast to the main actor (player pawn) and get Health and get Max Health.
You should only really be using saves game data when loading or saving not to compere vars just as a side note.

Thanks for advice. That’s my first project in UE4 so I develop it continuously