Sitemap
Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Member-only story

5 essential tips if you want to start to use Unity 3D

4 min readApr 5, 2024

--

Unity

Custom class in Unity

This custom class is to do anything you want like add a game object or set something up before the scene loads after you click the play button.

This callback is invoked when the first scene’s objects are loaded into memory but before Awake has been called.

using UnityEngine;

public class Initializer
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void initialize() {
// Your Code
Debug.Log("Scene is loaded and game is running");
}
}

UI Button Trick in Unity

For the simple action, You don't have to write code to trigger this button. Here is how to do it:

Select Button and on the inspector tab, find this:

Click the plus icon. Here you can do quite a lot of things. For example, turning on gravity on the Rigidbody component. Drag your desired game object and select “bool useGravity”.

Inspector Debug Mode in Unity

This is the perfect way to monitor your private variable in case you want to debug code or find something wrong with your variable value without exposing it as public or using Debug.Log.

--

--

Bootcamp
Bootcamp

Published in Bootcamp

From idea to product, one lesson at a time. To submit your story: https://tinyurl.com/bootspub1

Shakir
Shakir

Written by Shakir

I do 3d and write code with a passion for game development and software, and 3d.

No responses yet