Your First 3D App - Part A: Introduction
Let's build your first 3D app using the Ursina engine!
Learning Goals
When you finish this lesson, you'll be able to do the following:
- Understand how to import the Ursina engine
- Learn how to create a game window
- Learn how to create a 3D cube
- Learn how to use variables to store information
What do you make?
In this lesson, we'll build your first 3D app with the Ursina engine!

- Creating an Ursina game window
- Creating a red 3D cube
- Managing properties with variables
- Printing console messages
Run time: about 2 minutes Difficulty: (Beginner)
Take a look at the code
Below is the code that builds your first 3D app. Take a close look at it!
Folder: one_basics_and_setup / File: hello_ursina.py
hello_ursina.py
from ursina import * # (1)
# Create the game window
app = Ursina() # (2)
# Variables - store information
my_name = "Student" # (3)
cube_size = 2 # (4)
cube_color = color.red # (5)
# Print to console
print("Hello, Ursina!") # (6)
print(f"My name is {my_name}") # (7)
# Create a 3D cube
my_cube = Entity( # (8)
model='cube',
color=cube_color,
scale=cube_size
)
# Run the game
app.run() # (9)
- Imports all of the features from the Ursina library.
*means "everything." - Creates a game window and
appstores it in a variable. This is the basic frame of our game. - Creates a variable that holds a string. It stores the name "Student."
- A number variable that determines the size of the cube. 2 means twice the default size.
- A variable that determines the color of the cube.
color.redmeans the color red. - Prints "Hello, Ursina!" to the console (terminal).
- Uses an f-string to print a message that includes the variable's value.
{my_name}gets replaced with "Student." Entity()creates a 3D cube and sets its shape, color, and size.- Runs the game window and displays it on the screen. Without this line, the window won't appear!
How to Run It (Required)
- Move to terminal:
cd ..aftercd folder_name - Run:
python filename.py(autocomplete with the Tab key) - Exit: Alt+F4 (Win) / Cmd+Q (Mac)
How to Control It
Most games use the standard control scheme:
- WASD Or Arrow keys: move
- Mouse: adjust view / aim
- Left click: shoot / interact
- Space: jump (platformer games)
- Tab: toggle slow motion (slow_motion.py)
- Escape: quit the game