Show Menu

Unity 3D (C#) - Common Functions Cheat Sheet (DRAFT) by

Common Unity 3D functions/snippets

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Common Code Snippets

Paren­tGa­meO­bje­ct.t­ra­nsf­orm.Ge­tChild (0)
Get child component of GameObject
Rigid­bod­y.A­ddT­orq­ue(­(Ve­ctor3 torque, ForceMode mode = ForceM­ode.Fo­rce)
Continuous force along the direction of the force vector

C# Principles

(cond­ition1 && condit­ion2) ? true : false
A single line condit­ional statement
public <ty­pe> <na­me> {get; set;}
Single­-line property creation (prop in VS)
public Apple(­string newColor) : base(n­ewC­olor)
This specifies the parent constr­uctor if a constr­uctor is not already present

Free Assets


Useful Links


Support Cheatography!