Jason Schneider
Jun 17, 2021

Coding in C# — Using IF Statements

IF statements are used to make game logic based on some conditions. IF and AND statements can only run inside of methods such as void Start () and void Update().

The syntax of an IF statement is as follows:

To make coding simpler, you should write out what you want to achieve first; pseudo code; then convert it to code.

A simple IF statement that adds ten to a variable score every time the space key is pressed.

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

No responses yet

Write a response