# Setting stat Magnitude with negative float

**URL:** <https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [January 7, 2025, 4:24pm UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583 "2025-01-07T16:24:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LilWikipedia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lilwikipedia/32/1139663_2.png) [@LilWikipedia](https://forums.unrealengine.com/u/LilWikipedia)\
**Post date:** [January 7, 2025, 4:24pm UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/1 "2025-01-07T16:24:48Z")

</div>

I am trying to set a magnitude for the stat power up collectable based on certain game events and when I set a negative magnitude the call fails… Is this not a feature or am I doing something wrong?  
The calls with the green checkmark complete as expected…

 ![stathelp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/8/b685828cf105ca311260656b43e6de53e60f5ff2.png)

---

<div class="post-metadata">

**Author:** ![Shabuway](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shabuway/32/1021794_2.png) [@Shabuway](https://forums.unrealengine.com/u/Shabuway)\
**Post date:** [January 7, 2025, 10:25pm UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/2 "2025-01-07T22:25:00Z")

</div>

The API for that call says it’s clamped to what’s set in the device. What is your magnitude set to on the device itself?

```auto
    # Used to increase or decrease a stat for an `agent`.
    stat_powerup_device<public> := class<concrete><final>(powerup_device):
        # Sets the *Magnitude* for this powerup, clamped to the Min and Max defined in the device.
        # Will not apply to any currently applied effects.
        # For the Stat Powerup, this is the value of the stat that the powerup will add or remove to a player that picks up the powerup.
        SetMagnitude<public>(Magnitude:float):void = external {}

        # Returns the current *Magnitude* for the powerup.
        # For the Stat Powerup, this is the value of the stat that the powerup will add or remove to a player that picks up the powerup.
        GetMagnitude<public>()<transacts>:float = external {}

```

---

<div class="post-metadata">

**Author:** ![LilWikipedia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lilwikipedia/32/1139663_2.png) [@LilWikipedia](https://forums.unrealengine.com/u/LilWikipedia)\
**Post date:** [January 9, 2025, 1:50am UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/3 "2025-01-09T01:50:45Z")

</div>

I have it set at 10.0, so it theoretically the call should work being set as anything from -10.0 to 10.0 right? Or am I missing something? The documentation mentions in regards to the `stat_creator_device` that if you are not using levels then the call wont work but if you are then it succeeds? The `stat_powerup_device` is intrinsically connected so I am positive those settings have effect over my usage but the verbiage in the docs and api is not very good…maybe ill see if claude or gemini can rephrase how the usage and api docs are written and get a better understanding cause im super confused and being that it’s persistable it’s almost impossible to simulate and test the settings of the device[s]

---

<div class="post-metadata">

**Author:** ![fabtjar](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fabtjar/32/941183_2.png) [@fabtjar](https://forums.unrealengine.com/u/fabtjar)\
**Post date:** [January 10, 2025, 10:03am UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/4 "2025-01-10T10:03:57Z")

</div>

It doesn’t look like the Min/Max for the Magnitude isn’t exposed for us to use. Maybe you could run loads of `SetMagnitude` and `GetMagnitude` tests to see what the Min/Max is.

---

<div class="post-metadata">

**Author:** ![LilWikipedia](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lilwikipedia/32/1139663_2.png) [@LilWikipedia](https://forums.unrealengine.com/u/LilWikipedia)\
**Post date:** [January 10, 2025, 6:53pm UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/5 "2025-01-10T18:53:40Z")

</div>

I found a solution by simply creating two separate stat power ups, one for raise and one for decrease.  
The default setting that you set in the devices dictates the max you can set dynamically with verse

 ![solution](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/8/718575ccce86eb8ba2928825b50e1616290cec69.png)

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [February 9, 2025, 6:54pm UTC](https://forums.unrealengine.com/t/setting-stat-magnitude-with-negative-float/2264583/6 "2025-02-09T18:54:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
