Catching Health: How to Use Fish Items in Fortnite
Tutorial beginner

Catching Health: How to Use Fish Items in Fortnite

Updated beginner

Catching Health: How to Use Fish Items in Fortnite

Welcome, future game creator! Today we are going to make your island feel alive. You know how in real life, if you get hurt, you might eat an apple? In Fortnite, fish can do that for players!

We will build a small fishing spot. When players catch a fish, they get healed or get a special power boost. This makes your island fun to explore. Let’s catch some code!

What You'll Learn

  • What Consumables are (items you use once).
  • How to place fish items directly on your island.
  • How to use a Timer to make fish appear again.
  • How to give players a "buff" (a cool power-up).

How It Works

Imagine you have a magic box. Every time you open it, you get a snack. That snack gives you energy. In Fortnite, these snacks are called Consumables.

Fish are special consumables. They are like health potions that look like fish. Here are some cool ones:

  • Small Fry: Gives a little bit of health.
  • Shield Fish: Gives you a blue shield. It protects you from damage!
  • Slurpfish: Gives you both health and shield over time.

You can place these fish on your island. But wait! If a player eats the fish, it is gone forever. That is not very fun. So, we need a way to make the fish come back. We use a Timer. A timer is like a kitchen clock. It waits for a set time, then does something. We will tell the timer to wait five seconds. Then, it will drop a new fish!

Let's Build It

We will create a simple fishing hole. When a player steps in, they get a fish. A timer will reset so they can get another one later.

Here is the Verse code. It might look scary, but we will break it down line by line.

# This is our main script file
using { /Fortnite.com/Devices }
using { /Fortnite.com/Devices/Timer }
using { /Fortnite.com/Devices/Player }

# We create a "Device" called FishSpawner.
# Think of this as the box that holds our code.
FishSpawner = device:
    # This is the Timer device.
    # It counts down seconds.
    MyTimer = timer:

    # This is the spot where fish appear.
    # We call this a "Spawn Point".
    SpawnLocation = location:

    # This function runs when the game starts.
    OnBegin<override>()<suspends>:
        # Start the timer now!
        # It will wait 5 seconds.
        MyTimer.Start(5.0)

    # This function runs when the Timer finishes.
    OnTimerDone<override>()<suspends>:
        # 1. Create a new fish item.
        # We pick "Shield Fish" for this example.
        NewFish := Item.Create(ShieldFish)

        # 2. Put the fish at our SpawnLocation.
        # Imagine dropping it from the sky.
        NewFish.Place(SpawnLocation)

        # 3. Start the timer again!
        # This makes the fish come back later.
        MyTimer.Start(5.0)

    # This function runs when a player touches this device.
    OnPlayerBeginOverlap<override>(other: Player)<suspends>:
        # Check if the player is close enough.
        # If yes, give them a fish!
        # Note: We also restart the timer here.
        MyTimer.Start(0.0) # Reset timer immediately

Walkthrough of the Code

  1. using { ... }: These lines tell Verse where to find the tools we need. We need Devices (like timers) and Players.
  2. FishSpawner = device:: This is our container. It holds all the parts of our mini-game.
  3. MyTimer = timer:: We create a timer inside our device. This is the clock that controls when fish appear.
  4. SpawnLocation = location:: This is a specific spot in 3D space. It is where the fish will pop into existence.
  5. OnBegin: This runs once when the island starts. It starts our timer for 5 seconds.
  6. OnTimerDone: This is the magic part! When the 5 seconds are up, Verse creates a Shield Fish. It places it at our SpawnLocation. Then, it starts the timer again. Now the cycle repeats!
  7. OnPlayerBeginOverlap: This runs when a player walks into the device. We reset the timer to 0 seconds. This means the next fish will appear very quickly after a player arrives.

Try It Yourself

Now it is your turn to build!

Challenge: Change the code to use a Small Fry instead of a Shield Fish.

Hint: Look at the line that says Item.Create(ShieldFish). Can you change the name inside the parentheses?

Bonus Challenge: Change the timer from 5.0 to 2.0. What happens when you play your island now?

Recap

You just built a working fishing system! You learned that:

  1. Consumables are items like fish that give health or shields.
  2. Timers help us make things happen after a delay.
  3. Functions like OnTimerDone let us write rules for our game.

Great job, coder! Your island is now a place where players can fish for power-ups. Keep experimenting and have fun!

References

  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-fish-consumables-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-fish-items-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-fishing-consumables-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite/using-fishing-items-in-fortnite-creative
  • https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-consumables-in-fortnite-creative

Verse source files

Turn this into a guided course

Add using-fish-consumables-in-fortnite-creative to your free study plan — we'll suggest related pages and stitch the lot into one compile-checked, self-guided lesson with worked examples and quizzes.

Original tutorial generated by Verse Island from the Verse/UEFN knowledge base, with references to the Epic Games sources above. Code is validated against the knowledge base.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in