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

From Nurse to Software Developer

Using container images with AWS Lambda

Tips from the trenches: How to startup three new Scrum teams simultaneously.

Starting a Django Project

Trias Weekly Report (Nov 2, 2020 — Nov 8, 2020)

Job Hunting Guide for Self-Taught Developers

From Hacker to Organizer

UNIT-5 Construct Week Project at Masai (YOOX(Designs)[REACT])

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

MMA Scribbles Newsletter — Issue #31

World Famous on ArterNet Art’ — Paige Ring — is our Featured Guest Artist

The Subtle Art of Not Giving a F*ck: the suffering of that ancient famous dude

The Most Important 10-Letter Word to MASTER Any Language You Want