Unity C#


Write to console: Debug.Log(“Hello World”);

more exemples here: https://gamedevbeginner.com/how-to-use-debug-log-in-unity-without-affecting-performance/

 

Debug.Log

Read parent’s script variable:

https://docs.unity3d.com/ScriptReference/GameObject.GetComponentInParent.html

public GameObject objectToCheck;
parentComp comp= objectToCheck.GetComponentInParent<parentComp >();
then use comp.var as needed (with var a variable set in parents component (script))

 

 

Array, List:

https://gamedevbeginner.com/how-to-use-arrays-in-unity/

PDF: How to use Arrays in Unity – Game Dev Beginner

 

Vector3

Unity Vector3 Guide for Newbies

Shortforms of Vector3

Vector Shortform
Vector3(0, 0, -1) Vector3.back
Vector3(0, -1, 0) Vector3.down
Vector3(0, 0, 1) Vector3.forward
Vector3(-1, 0, 0) Vector3.left
Vector3(1, 1, 1) Vector3.one
Vector3(1, 0, 0) Vector3.right
Vector3(0, 1, 0) Vector3.up
Vector3(0, 0, 0) Vector3.zero