- Data Type
- Value : Containing Some Values | if a Value type changes, only that specific variable is affected
- int
- float
- double
- boll
- char
- Structs(containing one or more other variables)
- Vector3
- Quaternion
- …
- Reference : Containing a Memory Addresse where the value is stored | if a Reference type changes, all variable that contain that memory address will also be affected
- Classes
- Transform
- GameObject
- Classes
- Value : Containing Some Values | if a Value type changes, only that specific variable is affected
UNITY TUTORIAL | SCRIPTING | Time.deltaTime

- when trying to move Player, add Time.deltaTime to make the movement soft
- it makes action in Update(), independent from frame and dependent on time


- let’s try to remove Time.deltaTime


UNITY TUTORIAL | SCRIPTING | GetComponent()
Unity Tutorial | Scripting |Getcomponent()
Script itself is a custom game component
also, in a script, we can modify other components such as “RigidBody”, “Collider”, or even another “Script”
to modify components in a script we need variables as a bowl for the component and we need to put the component in the variable by using “GetComponent()”

- Create a variable “GameManager” as a bowl to bring and use “Gamemanger” script or class in this script

- there is a custom function, “SetGameManagerState()” in “GameManager” script or calss

- put the class in the variable by using “GetComponent()”
- after that, we can use the functionality of “GameManager” class in this script

- in “Player” GameObject,
- “PlayerControl” scrip & “Audio Source” are attached
- we want to use “Audio Source” in “PlayerControl” Script

- In “PlayerControl” Script,
- create a variable as a bowl for “Audiosource”
- put the class by using “GetComponent()”
- use “AudioSource”
UNITY | TUTORIAL | Scripting | Linear Interpolation




UNITY TUTORIAL | SCRIPTING | Destroy()






