WHAT TO ADD IN GLOBAL VOLUME:
[Link] Processing:
-Post processing is used to add some color correction on display.
-To add post processing you fisrt add tone mapping on global volume and toggle on
post-procesing in camera if it's not on.
.Color Adjustment:
-This can be use to add post exposure,contract,saturation,etc.
.Bloom:
-With Bloom you can add threshod and intensity.
.Vignette:
-This add darkness/dark color around the corners
CHARACTER CONTROLLER:
.To normalize the vector:.normalized
.To attach the movement on the player:[Link],and also make sure the
script is attach to the character,
[Link] is a Vector3,and whenever you do a movement logic alway multiply
by [Link] or the character will be moving
with an unusual speed and also you can still add the moving speed you want if the
character is moving very slow.
.To make your game object rotate or look at a
direction:[Link],[Link],[Link],to get a smooth
rotation,you
can use [Link]/[Link].
ANIMATOR:
.Animator is a state machine
.Add a compnent of animator to the character,this need a animator controller which
you can create on project files
.Transition can be activated by creating a parameter of int,float or bool and add
the condition in the transition
.Create a C# script and add it to your object visual.
.On Awake() You can access the animator by using GetComponent() as the C# script is
directly attached to the player visual,
you can access the character you want to use animator my using the SerializedField
to create a reference.
.To access the parameter you can use different function by using
[Link],[Link]:This take two parameters,the
name of the animator parameter and the condition you want and if you did'nt see any
changes set it on Update.
CINEMACHINE:
.Cinemachine is a unity tool that makes handling the camera easy.
.To use cinemachine you'll need to create cinemachine virtual camera,you can create
virtual camera by clicking on GameObject
>Cinemachine>virtual camera or you can click on the option you want.
.Cinemachine does'nt replace the camera but work on top of the camera.
INPUT SYSTEM:
.After installing the input system in Unity registry,you can enable it manually by
going to edit> project settings>Player>>
Other settings>Active input handling.
.On the project file create an input action and open it.
.Action map is how you can have different maps,which performs different things,like
when the player is walking,driving,etc.
.Action is a property for individual action map,which you can use to make the game
object perform what you want.
.You can use the input system on your code by:
-Adding a player input component in your game object and attach the input action
assets on the Actions.
-Clicking on Generate C# class in the input action you created,after that,go to
your input script and construct the script
class that was auto generated on Awake(),and to activate
[Link] and you can use in the
function you created like: Vector2 name =
[Link]<Vector2>().
COLLISION DETECTION:
.On your parent game object add a box collider and edit the size that fit the
visual,
.To detect a solid object you'll use functions which is inside the physics class.
.[Link](Vector3 origin,Vector3 direction,float maxDistance):
-This will return a boolean,if it hit something (true),if not (false).
-The origin is the game object current postion,which you can get through
[Link].
-The direction is basically the direction you're directing the game object.
-The maximum distance can be the player size or width.
.[Link](Vector3 point1,Vector3 point2,float radius,Vector3
direction,float maxDistance):
-point1 is basically the buttom of the game object or player,which you can get
through [Link].
-point is basically the player top or head,which you can get through
[Link] + [Link] * playerHeight.
-radius is the player size.
-direction is the movement direction.
-maxDistance is the actual movement,which is the movementSpeed * [Link].
.To make the palyer move diagonally,
INTERACTION:
-To interact with an object you can use the raycast,[Link](Vector3
origin,Vector3 direction,out RaycastHit hitInfo,
float maxDistance).
-This type of raycast have an output parameter called RaycastHit which can be use
to interact to an object.
-The go inside the hitInfo,[Link].
-To identify the object,[Link](Type type,out Component
component).
-The TryGetComponent take a parameter of the type,basically the type of object and
an also an output Component,which you can
use like:[Link](out
TheClassAttachedToYourGameObject),this return a boolean.
-LayerMask:This is also a parameter inside raycast,this can be used when you want
to interact with a particular game object.
PREFAB:
-This can be used when you're trying to make multiple instances of a game object of
same kind.
-This is important when you what to make a change or have the same use the same
game object next time.
SINGLETON PATTERN:
-This is used when you want to have just one instance of something.
-You can also use property in this case and also set it on Awake.