Cameras

Properties:

Clear Flags:

Skybox: If you want the sky to not interact game objects, then with skybox the camera draws a skybox.

https://youtu.be/9ll6UP-kG40?t=726

 

Solid Color: Sky is just a solid color.

https://youtu.be/9ll6UP-kG40?t=786

 

Depth only: If the rays collide with a game objects, then it doesn’t draw anything.

https://youtu.be/9ll6UP-kG40?t=812

 

Don’t Clear: Doesn’t update camera to new thing, keeps old thing, causing “Streak”

https://youtu.be/9ll6UP-kG40?t=835

 

Culling Mask:

Turn things on and off.

https://youtu.be/9ll6UP-kG40?t=907

 

 – Depth:

Controls what order cameras are drawn into the scene.

First camera drawn is on the bottom.

Second camera is always drawn onto the first, third onto second, etc.

– Two Cameras at once:

Make one depth only while the other is skybox. Both must have the same depth.

 

RayCasting

  • RayCasting

A RayCast is an invisible Ray that detects colliders

Origin of a Ray is a point in the space

Origin is stored as a vector 3 with x, y, and z position.

Second Vector 3 to store direction.

You can use Ray Variable as it stores 2 vector 3’s

RayCastHit hitInfo stores info on colliders hit

you can also add floats like distance (to define length of the ray) and Layer mask for objects that you want the ray to ignore (if its put on a specific layer)

If statement for collision with environment tag

Joints

  • Fixed Joints

    Works like parenting

Can be linked to a point in the world or a RigidBody

Break Force and Break Torque – Amount of force needed to break the joint.

  • Spring joints

    GameObject is trying to reach a target position

Target position = position its set to in the scene view

Any RigidBodies attached will try to pull it from this position on an invisible spring attached to an anchor point

Anchor is the pivot point – shown as orange dot/box

Spring parameter = how strong the spring is

Higher value = tighter/stronger spring

Damper = how much the joint will slow down in motion

Higher the damper value = how much less the spring will overshoot

Min/Max distance is a dead zone

Spring also has break force and break torque

  • Hinge Joints

Ideal for Doors

Axis – hinge the object rotates around

Set anchor for its axis – still represented in orange

You can use spring settings under “Use Spring”

Motors apply force constantly, like a revolving door

Target velocity – speed its trying to rotate

Force – how easily the speed can be changed by collision

Free spin checkbox – will not decelerate

Limits contain your pivot

Min and Max are limits to the angles

Min/max bounce are how much it will bounce off of its limits

Also has Break Force and Torque

  • My use of joints in Unity

Joints Vid-1afb631