Day 1: Variables

Objective: To better understand variables as dynamic data that can change at runtime. Variables are how we manipulate data rather than hard coding values.

There are 4 main data types when working with variables (int, float, string, bool), but other components recognized by unity can be referenced as a variable.

Variables can be private or public. This will determine if the values can be overwritten by the editor or if they will be hidden from anything trying to access them.

Variables also depend heavily on scope. They can be global and accessible by every method in a class or they can be local to a singular method within a class.

In this project for example we control the speed, direction, and bounds that affect the players movement and capability.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Philip Johnson
Philip Johnson

No responses yet

Write a response