Floor Func error

Summary

using { /Verse.org/Random }
using { /Verse.org/Verse }

OnBegin():void=

var RandomFloat : float = GetRandomFloat(RandomFloatLow, RandomFloatHigh)
var RondomInt : int = Floor[RandomFloat]

Error:
This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context. The ‘decides’ effect indicates that the invocation calls a function that might fail, and so must occur in a failure context that will handle the failure. Some examples of failure contexts are the condition clause of an ‘if’, the left operand of ‘or’, or the clause of the ‘logic’ macro.(3512)

Please select what you are reporting on:

Unreal Editor for Fortnite

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

using { /Verse.org/Random }
using { /Verse.org/Verse }

OnBegin():void=

var RandomFloat : float = GetRandomFloat(RandomFloatLow, RandomFloatHigh)
var RondomInt : int = Floor[RandomFloat]

Expected Result

using { /Verse.org/Random }
using { /Verse.org/Verse }

OnBegin():void=

var RandomFloat : float = GetRandomFloat(RandomFloatLow, RandomFloatHigh)
var RondomInt : int = Floor[RandomFloat]

Observed Result

using { /Verse.org/Random }
using { /Verse.org/Verse }

OnBegin():void=

var RandomFloat : float = GetRandomFloat(RandomFloatLow, RandomFloatHigh)
var RondomInt : int = Floor[RandomFloat]

Platform(s)

UEFN, Verse

var RondomInt : int = Floor[RandomFloat] needs to be inside a failure context so if() or for() they is a list of the different options available to you. The Indicates and helps visual this to you thats how ive always thought about it.

if(var RondomInt : int = Floor[RandomFloat]):
# Do Your Code

Check This…

2 Likes

Thank you, At AshTag.
It works! It’s a new learning experience for me!

1 Like

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