Summary
When a players Shield is set using the fort_character.SetShield() despite the digest (SetShield function | Unreal Editor for Fortnite Documentation | Epic Developer Community) saying that it will clamp it between 0 and MaxShield, it does not seem to be fully the case.
Despite showing as clamped to the MaxShield when calling GetShield or By seeing the shield in the fortnite UI it seems to still be higher than the max shield
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
- Create a verse device that sets the shield using the .SetShield(999.0) on a fort_character and connect it to a button or trigger
- Place something that damages the player, could be something like a trap or a damage volume
- Start the game, press the button or trigger that would set your shield and take damage
- Notice that the shield will “tank” more damage than its supposed to and go in the negatives
Expected Result
.SetShield() should as the digest say properly clamp the value down to the maxshield
Observed Result
.SetShield() does not properly clamp the shield down to the maxshield value
Platform(s)
windows
Upload an image
Video
Additional Notes
The Verse Script that I have used in the video:
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /Fortnite.com/Characters }
health_setter := class(creative_device):
@editable SetHPTrigger : trigger_device = trigger_device{}
@editable CheckHPTrigger : trigger_device = trigger_device{}
OnBegin<override>()<suspends>:void=
SetHPTrigger.TriggeredEvent.Subscribe(OnTriggered)
CheckHPTrigger.TriggeredEvent.Subscribe(CheckHP)
OnTriggered(MaybeAgent:?agent):void=
if(Agent:=MaybeAgent?,FortChar:=Agent.GetFortCharacter[]):
Print("YOUR MAX SHIELD IS: {FortChar.GetMaxShield()}")
FortChar.SetShield(400.0)
Print("YOUR MAX SHIELD AFTER SET IS: {FortChar.GetMaxShield()}")
Print("YOUR CURRENT SHIELD AFTER SET IS: {FortChar.GetShield()}")
CheckHP(MaybeAgent:?agent):void=
if(Agent:=MaybeAgent?,FortChar:=Agent.GetFortCharacter[]):
Print("YOUR MAX SHIELD IS: {FortChar.GetMaxShield()}")
Print("YOUR CURRENT SHIELD IS: {FortChar.GetShield()}")