Movement and Mouselook Flashcards

1
Q

How do you deal with Unity speeding up at higher FPSs?

A

Use Time.deltaTime and multiply that by the movement speed.

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

Describe a left-handed coordinate system.

A

X-axis goes left to right.
Y-axis goes down to up.
Z-axis goes from out of the screen to into the screen.

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

How do you limit numbers or vectors to a certain value?

A

By clamping them.

Mathf.Clamp()
Vector3.Clamp()

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

How do you make a component required?

A

[RequireComponent (typeof(component))]

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

How do you add a script to the component menu?

A

[AddComponentMenu(“menu/name”)]

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

How do you stop the game world affecting the character’s rotation?

A

GetComponent(RigidBody)freezeRotation = true

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

How do you make a character move?

A

Get input using Input.GetAxis(“Horizontal”) and Input.GetAxis(“Vertical”) and GetComponent().Move(Vector3) but use transform.TransformDirection(Vector3) on the vector first so it uses local axes.

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

How do you get the mouse movement info?

A

Input.GetAxis(“Mouse X”)
Input.GetAxis(“Mouse Y”)

Returns float value from -1 to 1.

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