Video Games Development

Unity 3D – Camera – Third Person Control

Unity 3D – Camera – Third Person Control

1. Create a ball that rolls over a plane

2. Creare a Camera with:
– CameraController.js

#pragma strict

public var player : GameObject;
private var offset :  Vector3;

function Start () {
offset = transform.position;
}

function LateUpdate () {
//LateUpdate is called after all Update functions have been called. 
// This is useful to order script execution. For example a follow camera should always be implemented in LateUpdate because it tracks objects that might have moved inside Update.
transform.position = player.transform.position + offset;
}

2. Hierarchy DRAG AND DROP ‘ball’ GameObject over Inspector> CameraController.js ‘player’ variable slot.

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Camera – Third Person Control

Unity – Image Effects

Unity – Image Effects

They are Render Texture-based fullscreen image postprocessing effects.

MAIN TOP MENU> Assets> Import Package> Image Effects

Project> Standard Assets> Image Effects (Pro Only)> DRAG AND DROP the scripts over the Hierarchy> Camera

NOTICE: You can apply multiple Image Effects to the same camera.

Complete List:

Antialiasing (PostEffect)

Bloom
FastBloom
Bloom and Lens Flares

Blur Effect
Blur
Camera Motion Blur

Color Correction Curves
Color Correction
Color Correction Lookup Texture

Contrast Enhance
Contrast Stretch

Crease

Depth of Field 3.4
Depth of Field

Edge Detection
Edge Detect Effect Normals

Fisheye

Global Fog

Glow

Grayscale

Motion Blur

Noise And Grain
Noise

Screen Overlay

Sepia Tone

Sun Shafts

Screen Space Ambient Obscurance
Screen Space Ambient Occlusion (SSAO)

Tilt Shift
Tilt Shift

Tonemapping

Twirl

Vignetting (and Chromatic Aberration)

Vortex

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Image Effects

Unity 3D – Get Axis – rigidbody.velocity

Unity 3D – Get Axis – rigidbody.velocity

1. Create a Plane (Ground) with:
– Mesh Collider

2. Create over the plane a Sphere with:
– Mesh Collider
– Rigid Body
– PlayerController.JS:

#pragma strict
 
function Start () {
 
}
// Theese variables are public to make the code easy-reusable
// You can setup theese variables from Inspector
var speed : float;

function FixedUpdate () {
     // Get User Input START
     var moveHorizontal : float= Input.GetAxis ("Horizontal");
     var moveVertical : float= Input.GetAxis ("Vertical");
     // Get User Input END

     var movement : Vector3= new Vector3 (moveHorizontal, 0.0f, moveVertical);
    rigidbody.velocity = movement * speed;
}
By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Get Axis – rigidbody.velocity

Unity 3D – Get Axis – rigidbody.AddForce

Unity 3D – Get Axis – rigidbody.AddForce

1. Create a Plane (Ground) with:
– Mesh Collider

2. Create over the plane a Sphere with:
– Mesh Collider
– Rigid Body
– PlayerController.JS:

#pragma strict
 
function Start () {
 
}
// Theese variables are public to make the code easy-reusable
// You can setup theese variables from Inspector
var speed : float;

function FixedUpdate () {
     // Get User Input START
     var moveHorizontal : float= Input.GetAxis ("Horizontal");
     var moveVertical : float= Input.GetAxis ("Vertical");
     // Get User Input END

     var movement : Vector3= new Vector3 (moveHorizontal, 0.0f, moveVertical);
     rigidbody.AddForce (movement * speed * Time.deltaTime); // Time.deltaTime Use this function to make your game frame rate independent
}
By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Get Axis – rigidbody.AddForce

Unity 3D – Cloth Simulation

Unity 3D – Cloth Simulation

Base

1. MAIN TOP MENU> GameObject> Create Other> Sphere

2. MAIN TOP MENU> GameObject> Create Other> Cloth, put the cloth over the Sphere

3. InteractiveCloth> Inspector> Interactive Cloth> Mesh> select a mesh

TOP BUTTON ‘Play’

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Cloth Simulation