UEFN: Verse: Epic tutorial uses 'race' but results in error (search_and_destroy example)

Im following the UEFN tutorial on how to make the search_and_destroy example.
When I get to the part of using the race concepts I keep getting errors. I don’t know what I am doing wrong?

Im using UEFN 5.1.1

Error 1:
All the top level expressions in a 'race' macro must be async (such as a coroutine call) and not immediate.

Error 2:

Expected async expression(s) (such as a coroutine or concurrency primitive) and only found immediate expression(s) (such as an immediate function call).

    OnBegin<override>()<suspends>:void=
        # The race expression is used to run a block of two or more async expressions concurrently (simultaneously). 
        # When the fastest expression completes, it "wins the race".
        # https://www.fortnite.com/en-US/creative/docs/uefn/race-in-verse
        race:
            block:
                Print("Hello, world 1!")
            block:
                Print("Hello, world 2!")

Here is the tutorial: Verse Detonation Template | Epic Developer Community (epicgames.com)

The issue is that you need an asynchronous function inside the block. Asynchronous functions have the <suspends> specifier. Print is not an asynchronous function, which is why you are getting an error. If you try with something like Sleep(1.0), it would work because it is an asynchronous function

2 Likes