Show Menu
Cheatography

Unity3D with UnityScript Cheat Sheet (DRAFT) by

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

MonoBe­havior — Base Class of all Scripts

Most scripts attach to a game object — an object that is part of your Unity3D scene. All scripts inherit from MonoBe­havior, which inherits from Object base classes.

Event Messages

Message
Called when ...
UPDATE EVENTS
Awake()
... script is loading
Start()
... script starts
Update()
... every frame
FixedU­pdate()
... every fixed framerate (best for physics)
LastUp­date()
... after Update() and FixedU­pdate()
COLLISION EVENTS
OnCollisionEnter()
... object first collides with something
OnColl­isi­onS­tay()
... while this object continues colliding
OnColl­isi­onE­xit()
... when object stops colliding with something
TRIGGER EVENTS
OnTrig­ger­Enter()
... object has something enter its trigger area
OnTrig­ger­Stay()
... another object remains in trigger area
OnTrig­ger­Exit()
... another object leaves this object's trigger area