Hello everyone,
I would like to recover the life and shield of a player in a variable in Verse, but I don’t know how to do it. Could you help me please? Thanks in advance!
if(FortChar:=Agent.GetFortCharacter[]:
FortChar.GetShield()
FortChar.GetHealth()
Thank you so much !
No problem, good luck on whatever you’re making that utilizes the fort character and don’t forget to read documentation for more functions regarding the fort character fort_character interface | Unreal Editor for Fortnite Documentation | Epic Developer Community
Thanks again, you helped me out a lot. And thanks for the Epic documentation as well.
Sorry to bother you, but my Agent
is of type ?agent
and no agent
. So it gives me an error. Here is my code:
@editable TriggerHealth_Add1 : trigger_device = trigger_device{}
OnBegin<override>()<suspends>:void=
TriggerHealth_Add1.TriggeredEvent.Subscribe(Health_Add1)
Health_Add1(A:?agent):void=
if (FortChar:=A.GetFortCharacter[]):
FortChar.GetShield()
FortChar.GetHealth()
My mistake is at the level of the expression: if (FortChar:=A.GetFortCharacter[]):
Could you help me again?
if(Agent:=Agent?,FortChar:=Agent.GetFortCharacter[]):
Thanks! One more question: how can you change the parameters of a class designer (maximum life, invincibility, etc …)
You can’t change a class designer at runtime, the values set in them are static you can have many class designers for each thing you want different
Ah! The goal of my device was to change a player’s life to fully customize it. For example, when a trigger is triggered, it decreases life by 1 HP; another, it increases it by 1 HP each time they are triggered… I don’t know if I was clear in my explanations, but I can’t find a solution to this problem…
You can use Fort_Character.SetMaxHealth() etc etc as mentioned in the documentation pages to change their health accordingly
Thank you so much !
thank you gis,
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.