Hide and Seek: The Magic Peeping Camera
Hide and Seek: The Magic Peeping Camera
Have you ever played hide and seek? It is super fun to hide, but it is hard to see if anyone is coming! In this tutorial, we will build a smart camera for your hide-and-seek island. This camera will only appear when a player hides. It lets them peek out safely. You will use Verse to control this magic. Let’s make your island feel alive!
What You'll Learn
- What an Orbit Camera device is.
- How to place it in your level.
- How to use Verse to turn it on only when needed.
- How to set the camera distance.
How It Works
Imagine you are inside a small tent. You want to see outside, but you do not want to step out. An Orbit Camera is like a magical eye that floats above you. You can look around with it.
In Fortnite Creative, we have a special device called Camera: Orbit. It lets players look around smoothly. But we do not want it on all the time. We want it to turn on only when a player hides.
This is where Verse comes in. Verse is the code that tells devices what to do. Think of Verse as a remote control. We will write code to say: "When a player enters the hiding spot, turn on the camera."
We also need to set the Distance. This is how far back the camera sits. If it is too close, the player might bump into walls. If it is too far, they might not see well. We will set it to a perfect view.
Let's Build It
We will build a simple hide-and-seek spot. We will use a Portapotty as the hiding spot. When a player goes inside, the camera turns on.
Step 1: Set Up the Scene
First, place a Portapotty on your island. This is our hiding spot. Next, place an Orbit Camera device nearby. Place it slightly above and to the side of the Portapotty. This helps the camera see over the roof.
In the Details panel (the menu on the right), find the Camera section. Set the Distance to 200 CM. This is a good starting point. Also, set Add Players on Start to Off. We want Verse to control this, not the default settings.
Step 2: The Verse Code
Now, we add the magic code. Create a new Verse file in your project. Paste this code in. It tells the game to watch for players hiding.
# This is our main script. It runs when the game starts.
using { /Fortnite.com/Devices }
using { /Verse.org/Sim }
# We create a script called HideAndSeekCamera.
# This script will control our camera.
hide_and_seek_camera := script class (IScript) {
# This is a "Device" variable.
# It holds the Orbit Camera we placed in the level.
# Think of it like a handle to grab the camera.
orbit_camera_device : OrbitCameraDevice
# This is an "Event". It triggers when a player starts hiding.
# We will connect this to the Portapotty later.
OnPlayerStartHiding := event (player : Player) {
# Here is the magic! We tell the camera to activate.
# Only the player who is hiding will see this view.
orbit_camera_device.Activate(player)
}
# This runs when the game begins.
OnBegin<override>()<suspends> : void {
# We wait for the game to start properly.
# Then we are ready to hide!
print("Hide and Seek is ON! Hide well!")
}
}
Step 3: Connect the Dots
The code is ready, but it needs to know which camera to use. We do this in the Outliner (the list of all objects).
- Click on your Portapotty device.
- In the Details panel, find the Events section.
- Look for an event called On Player Enter.
- Connect it to our script. You might need to create a new Verse Device or link the event to the script we made.
- In the script properties, drag your Orbit Camera from the Outliner into the
orbit_camera_deviceslot.
Now, when a player enters the Portapotty, the OnPlayerStartHiding event fires. The code runs orbit_camera_device.Activate(player). The camera turns on for that player!
What Each Part Does
orbit_camera_device: This is a variable. It is a box that holds the camera object. We use it to talk to the camera.OnPlayerStartHiding: This is an event. It is like a doorbell. It rings when a player hides.Activate(player): This is a function. It is an action. It tells the camera to show the player’s view.
Try It Yourself
You did it! You built a smart camera. Now, try this challenge:
Challenge: Change the Distance of the Orbit Camera in the Details panel. Try setting it to 300 CM. Playtest your island. Does the view look better or worse?
Hint: If the view is too far, try lowering the number. If it is too close, try raising it. Find the sweet spot!
Recap
You learned how to use an Orbit Camera device in Fortnite Creative. You learned to place it in your level. You used Verse to turn it on only when a player hides. This makes your game feel smart and fun. Great job, coder!
References
- https://dev.epicgames.com/documentation/en-us/fortnite/orbit-camera-device-design-example-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/orbit-camera-device-design-examples-in-fortnite-creative
- https://dev.epicgames.com/documentation/en-us/uefn/change-a-players-point-of-view-with-cameras-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite/change-a-players-point-of-view-with-cameras-in-unreal-editor-for-fortnite
- https://dev.epicgames.com/documentation/en-us/fortnite-creative/using-orbit-camera-devices-in-fortnite-creative
Verse source files
- 01-fragment.verse · fragment
Turn this into a guided course
Add Add the Orbit Camera Device 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.
References
Original guide 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.