Posts

Showing posts from March, 2020

Public Vector 3

Makes it easier because it'll store three numbers for the X, Y, and Z

Public Transform; Player

follow player: Mono Behavior { public transform player; public class follow player: Mono Behavior { public transform player; void update () { Debug.log (player.position); } Under "follow player" you can set the x, y, and z values to a number to arrange where the camera will be centered on the object when it dollies.

Colliding with Objects

"void OnCollisionEnter ()" { Debug.log "I hit a target!" } void OnCollisionEnter () { Debug.log (collisioninfo.collider.name) } movementenabled = false

Creating a script

SOURCE: https://docs.unity3d.com/Manual/CreatingAndUsingScripts.html

Essential Hotkeys

F - Frame object W - Move E - Rotate R - Scale T - ALT+RIGHT-CLICK - Zoom MMB - Pan CTRL+D - Duplicate

Prefabs

a lot of the same object

Fundamentals: Main Camera snaps to main object

if 'transform.position = player.position' is applied to a main camera on the code sheet under "void update", the main camera snaps to the object as soon as the game starts

transform.position

changes the position of the player you can add 'player.position' to bring it a player's position in your game ex: transform.position = player.position if applied to a main camera, the main camera snaps to the object as soon as the game starts

Time.deltatime

the amount of seconds the computer drew the last frame ex. 10 times per second - value: 1 ex. 20 times persond - value: .5

rb.AddForce method;

add force function wants to know about how much force it should add in the different directions this is placed under void start 0 on the x, 200 on the y axis, and 500 on the z axis but, to 'void update' function is 1s per frame that means every time your computer draws a new image multiple time per second this function will run

public float

stores numbers and words

What is Void Update?

update is called once per frame that means every time your computer draws a new image multiple time per second this function will run

Components

Componenents are what the objects do different things

Debug.Log

Code "Debug.Log {Hello World!}

Game Programming

Image

Scripting

Scripting is an essential ingredient in all applications you make in Unity. Most applications need scripts  to respond to input from the player and to arrange for events in the gameplay to happen when they should. Beyond that, scripts can be used to create graphical effects, control the physical behaviour of objects or even implement a custom AI system for characters in the game. SOURCE: https://docs.unity3d.com/Manual/ScriptingSection.html

What is a job system?

A job system is a system that allows you to use multi-threaded code by creating jobs instead of threads A job system manages a group of worker threads across multiple cores. It usually has one worker thread per logical CPU core, to avoid context switching (although it may reserve some cores for the operating system or other dedicated applications). A job system puts jobs into a job queue to execute. Worker threads in a job system take items from the job queue and execute them. A job system manages dependencies and ensures that jobs execute in the appropriate order. SOURCE: https://blogs.unity3d.com/2018/10/22/what-is-a-job-system/