# Why am I getting this error when calling this function

**URL:** <https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [September 2, 2023, 3:37pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847 "2023-09-02T15:37:16Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 2, 2023, 3:37pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/1 "2023-09-02T15:37:17Z")

</div>

I made a function that takes some inputs and also has Sleep() which is why there is suspends. The issue is that when I call it, I get an error. Can anyone help?

 ![image-4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/e/b/5eb05483e6a3257fff85a80700913d1d13a04b28.png)  
 ![image-3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/a/e/2ae1064e0b41b38fc53717326b9e4da36e400bf5.png)

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 2, 2023, 4:24pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/2 "2023-09-02T16:24:12Z")

</div>

spawn it

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 2, 2023, 7:42pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/3 "2023-09-02T19:42:47Z")

</div>

its not a spawner

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 3, 2023, 12:13am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/4 "2023-09-03T00:13:54Z")

</div>

as in, write:

```auto
spawn:
      randomOrder(ButtonHouse12, "House 12")

```

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 3, 2023, 7:01am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/5 "2023-09-03T07:01:39Z")

</div>

And also, do you know how I can update a text block (add text, not setting the text)

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 3, 2023, 7:34am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/6 "2023-09-03T07:34:45Z")

</div>

This might help:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/c/4/8c4d960af3c700ae4175f24def53bc2a53710cc4.jpeg "How To Make A Distance Tracker To Or From A Player In UEFN") ](https://www.youtube.com/watch?v=HVbM9eVJjUs)

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 3, 2023, 7:55am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/7 "2023-09-03T07:55:27Z")

</div>

In the video, you also use SetText, is there a way to instead add text to the already existing message

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 3, 2023, 7:58am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/8 "2023-09-03T07:58:32Z")

</div>

Not that I’m aware of. I’d probably just set a variable with the text value and then add to that and then set that variable as the text for the UI

---

<div class="post-metadata">

**Author:** ![Twin01](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/twin01/32/1077777_2.png) [@Twin01](https://forums.unrealengine.com/u/Twin01)\
**Post date:** [September 3, 2023, 8:00am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/9 "2023-09-03T08:00:13Z")

</div>

you use `SetText()` to change existing text on a button as well

(I feel like I’m sharing this every other day and I swear it isn’t on purpose) but I do it with this height meter script: [Height Meter for OnlyUp style maps | Uefn Code Snippet](https://dev.epicgames.com/community/snippets/rmmj/fortnite-height-meter-for-onlyup-style-maps)

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 3, 2023, 8:19am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/10 "2023-09-03T08:19:24Z")

</div>

that’s a good code snippet

---

<div class="post-metadata">

**Author:** ![nelmi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/nelmi/32/746978_2.png) [@nelmi](https://forums.unrealengine.com/u/nelmi)\
**Post date:** [September 3, 2023, 8:56am UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/11 "2023-09-03T08:56:59Z")

</div>

Hey, I found a solution to AddText but I ran into another issue, how can I round to Ceil(), it gives me this error

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/7/777ba88aae7f64886f86b1b4ee400bed4d59a0f1.png)

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 3, 2023, 3:29pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/12 "2023-09-03T15:29:56Z")

</div>

It literally tells you how to fix it. Use square brackets. Easy peazy

---

<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:** [October 3, 2023, 3:30pm UTC](https://forums.unrealengine.com/t/why-am-i-getting-this-error-when-calling-this-function/1280847/13 "2023-10-03T15:30:01Z")

</div>

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