Creating Scripts Flashcards

1
Q

transform on GameObject

A

accessible in script with just .transform, inherits from “transform” visible in Unity inspector.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Time.deltaTime

A

time to render previous frame

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Update() method called how often?

A

every frame

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Time.time

A

true time since start of game

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

tranform.Translate(…)

A

translates object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

namespaces

A

establish groupings between related objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

UnityEngine

A

namespace referring to when app is running

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

UnityEditor

A

namespace referring to extending Unity editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

jump directly in docs from Unity UI how?

A

click on book+? symbol in inspector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

create script how?

A

from unity editor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

: Monobehavior

A

MonoBehaviour is the base class from which every Unity script derives.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Start()

A

Start is called on the frame when a script is enabled just before any of the Update methods are called the first time.

Like the Awake function, Start is called exactly once in the lifetime of the script. However, Awake is called when the script object is initialised, regardless of whether or not the script is enabled. Start may not be called on the same frame as Awake if the script is not enabled at initialisation time.

The Awake function is called on all objects in the Scene before any object’s Start function is called. This fact is useful in cases where object A’s initialisation code needs to rely on object B’s already being initialised; B’s initialisation should be done in Awake, while A’s should be done in Start.

Where objects are instantiated during gameplay, their Awake function is called after the Start functions of Scene objects have already completed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Update()

A

Update is called every frame, if the MonoBehaviour is enabled.

Update is the most commonly used function to implement any kind of game script. Not every MonoBehaviour script needs Update.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

interact with GameObjects in script

A
  1. create empty GameObject in Unity.
  2. create script
  3. drag script onto GameObject
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Quaternion.identity

A

how to rotate object; identity same as matrix identity, not rotation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Prefab

A

store a GameObject on file

17
Q

Renderer

A

change color of object

18
Q

OBJECT.GetComponentInChildren

A

in OJBECT, find component in children, of type

19
Q

lerp and slerp

A

Lerp stands for linear interpolation and Slerp stands for spherical linear interpolation, and both rely on a time parameter that indicates how much to interpolate.

20
Q

sun.transform.rotation vs sun.transform.Rotate

A

rotation describes objective rotation in space, Rotate is change in rotation.

21
Q

to apply physics to object, need to apply

A

collider

22
Q

collider types

A

box
capture
mesh
sphere

23
Q

rigidbody is

A

a component that enables a gameobject to interface with the Unity physics simulation

24
Q

rigidbody properties

A

mass, drag, gravity, etc.

25
Q

raycasting?

A

shooting a ray out from a given point in hopes of hitting a collider from our scene

26
Q

FixedUpdate

A

like update, but where you should write code with that uses physics, rigidbody

27
Q

audio, 2d 3d

A

2d not in world (like music), 3d location dependent

28
Q

audiolistener

A

one audiolistener in scene (like camera) determines how to make audio from sources. by default on camera.

29
Q

using Unity.SceneManagement

A

GetActiveScene()

LoadScene()