# \`first\` in \`if\` doesn't work without \`true?\`

**URL:** <https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392>\
**Category:** Issues and Bug Reporting\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, closed, fortnite, verse\
**Created:** [August 30, 2026, 1:45pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392 "2026-08-30T13:45:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ForestTrener](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ForestTrener](https://forums.unrealengine.com/u/ForestTrener)\
**Post date:** [August 30, 2026, 1:45pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/1 "2026-08-30T13:45:04Z")

</div>

### Summary

Expression `first` doesn’t work in failable context (`if` condition clause) if you don’t have `true?` or any other failable expression in `first` after the generator or array

### Please select what you are reporting on:

Verse

### What Type of Bug are you experiencing?

Verse

### Steps to Reproduce

Here’s an example from my project in the context of a custom Scene Graph component. You can see I am trying to find the first descendant entity with `custom_tag`. I am using this syntax because I know that there is supposed to be one entity with such tag

```auto
custom_component := class<final_super>(component):

    OnBeginSimulation<override>():void =
        if:
            PlayerPoint := first(FoundEntity : Entity.FindDescendantEntitiesWithTag(custom_tag)) . FoundEntity
        then:
            # doing stuff with `PlayerPoint`
        else:
            Print("No entity with custom_tag found!")

```

Here’s an example with an array and not a generator

```auto
MyArray := array{1, 2, 3, 4 ,5}
if:
    FirstElement := first(Element : MyArray). Element

```

### Expected Result

Code compiles without a problem

`Entity.FindDescendantEntitesWithTag(custom_tag)` returns generator of all entites with `custom_tag`

If there is no entities found: `first` fails and “No entites with custom\_tag found!” is printed

If there is at least one entity: `first` succeeds, it returns `FoundEntity`, saves it to the `PlayerPoint` and then Verse doing everything else with `Playerpoint`

### Observed Result

Compiler throws an error (3503) “Expected an expression that can fail in the ‘if’ consition clause”

The error can be fixed by placing `true?` besides the generator in `first` like this:

```auto
custom_component := class<final_super>(component):

    OnBeginSimulation<override>():void =
        if:
            PlayerPoint := first(FoundEntity : Entity.FindDescendantEntitiesWithTag(custom_tag); true?) . FoundEntity
        then:
            # doing stuff with `PlayerPoint`
        else:
            Print("No entity with custom_tag found!")

```

with an array:

```auto
MyArray := array{1, 2, 3, 4 ,5}
if:
    FirstElement := first(Element : MyArray; true?). Element

```

### Platform(s)

PC

### Additional Notes

I don’t understand why there must be `true?` in `first`. This is a really strange syntax and there is no reason for it to be written like this

I know that `first` is usually used when you want to iterate through array/generator and get the first result that succeedes in condition. Here’s an example from the Book of Verse:

```auto
# Find the first player with a score above the threshold
FindTopScorer(Players:[]player, Threshold:int)<decides>:player =
    first (Player : Players; GetScore[Player] > Threshold):
        Player

```

But what if I just want to get the first result from a generator? Why I must have unfailable expression in `first` when it iterates through the first item in the generator? Finding the first value in itself can be considered a “success” especially if there is a possibility of getting no items in array/generator. `true?` doesn’t hold any meaning whatsoever in this context

What is a philosophy behind this if it is working as intended?

---

<div class="post-metadata">

**Author:** ![ForestTrener](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ForestTrener](https://forums.unrealengine.com/u/ForestTrener)\
**Post date:** [August 30, 2026, 1:53pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/2 "2026-08-30T13:53:07Z")

</div>

Here’s another funny thing. THIS compiles without `true?`

```auto
if:
    CameraEntity1 := first(CameraPoint : Entity.FindDescendantEntitiesWithTag(camera_point_1)) . CameraPoint
    Camera1 := CameraEntity1.GetComponent[camera_component]

```

Like??? What???

---

<div class="post-metadata">

**Author:** ![Zablabior](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zablabior/32/1148291_2.png) [@Zablabior](https://forums.unrealengine.com/u/Zablabior)\
**Post date:** [August 31, 2026, 1:42am UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/4 "2026-08-31T01:42:27Z")

</div>

Even if this is intended behavior, I would say we have odd error messages in the following cases right now.

```verse
Container := for. __:=0..1

first. __:Container # This first has the 'decides' effect, which is not allowed by its context. The 'decides' effect indicates that the first 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)

# Ok. Let's do it in a <decides> context.
if. first. __:Container # Expected an expression that can fail in the 'if' condition clause (3513)

```

The first error message says that first has the decides effect, so it can fail. The second one says that we require an expression that can fail inside the if condition. Would this not make the two error messages to contradict each other?

---

<div class="post-metadata">

**Author:** ![Flak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/flak/32/769441_2.png) [@Flak](https://forums.unrealengine.com/u/Flak)\
**Post date:** [August 31, 2026, 12:58pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/5 "2026-08-31T12:58:12Z")

</div>

Thanks for reporting @ForestTrener, getting this to the verse team.

---

<div class="post-metadata">

**Author:** ![EnebzVerse](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/enebzverse/32/1169872_2.png) [@EnebzVerse](https://forums.unrealengine.com/u/EnebzVerse)\
**Post date:** [September 1, 2026, 2:08pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/7 "2026-09-01T14:08:16Z")

</div>

Hi, a fix for this is currently in review 🙂

---

<div class="post-metadata">

**Author:** ![Bug-Reporter](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/bug-reporter/32/1223650_2.png) [@Bug-Reporter](https://forums.unrealengine.com/u/Bug-Reporter)\
**Post date:** [September 1, 2026, 4:03pm UTC](https://forums.unrealengine.com/t/first-in-if-doesnt-work-without-true/2747392/8 "2026-09-01T16:03:27Z")

</div>

FORT-1147008 has been ‘Closed’ as a duplicate of an existing known issue.
