Methods: The Poké Ball of Code

Methods are essentially a form of modularity; similarly to a Poké Ball (Your Method) holding a Pokémon (Your Code). There are default methods of class MonoBehavior that are used, as well as methods that can be created or more specific methods that have specific functions.

The big ones you’re going to see as soon as you create a C# script in Unity are:

For further Method explanation: https://docs.unity3d.com/Manual/class-MonoBehaviour.html
Privacy?

If you were curious, Unity defaults the methods privacy or “ability to be accessed” to “private” unless defined other-wise. That’s why the method that I had created has a privacy definition, unlike the ones that are shown once you create a C# script.

If I attach this to an empty in our Scene, what should happen is depicted, in order from top to bottom, on the left image:

Looks like we’re good

We’re gonna continue our dive into understanding how to better use these methods but I think we’ve got it so far.

--

--

--

If ambition and practicality amalgamated, it would be me! I am here to climb the mountains of my ambition and catalog my journey so that someone can be changed!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CS 373 Spring 2021 Week of Mar 29–Apr 4:

10 best tools for Oracle database

Women Who Code Connect Asia 2019

Install memcached in Django project

Synchronizer token pattern (STP)

How to Health Check Change

Lady diagnosing cancer

Understanding IPv4 address

Curated By Carla — Issue #15 — Crystal Clear Focus

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Andrew Lengen

Andrew Lengen

If ambition and practicality amalgamated, it would be me! I am here to climb the mountains of my ambition and catalog my journey so that someone can be changed!

More from Medium

Best SportsBook Ever

7 Productively Impeccable Sites For Best Homework Help

Exclusive Interview — Director Andre Relis on Randy Rhoads: Reflections of a Guitar Icon

7 Mistakes That Winning MLB Bettors Avoid