creazione siti web bologna

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 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

Unity 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

1. Create a NavMesh

2. Create a Sphere, Inspector> TOP RIGHT uncheck ‘Static’, name it ‘hero’

Hierarchy select ‘hero’> Inspector> ‘Add Component’> Navigation> NavMeshAgent, setup:

– Radius: l’ingombro dell’agente

– Speed: massima velocità dell’agente (utile per i giochi di corsa!)

– Acceleration: accelerazione massima dell’agente

– Angular Speed: velocità con la quale è in grado di girare

– Stopping Distance: distanza alla quale inizia a rallentare in prossimità di ‘targetNavigation’

– Auto Traverse Off Mesh Link:

– Auto Braking: se attivo l’agente si ferma automaticamento al raggiungimento di ‘targetNavigation’

– Auto Repath: se attivo l’agente ricalcola il percorso se quello precedente non è più valido

– Height: l’altezza dell’agente

– Base Offset: offset verticale del collider dell’agente

– Obstacle Aviodance Type: High Quality – Low Quality – precisione del calcolo per schivare gli ostacoli (meno è accurato, meno risorse occupa)

– Avoidance Priority: priorità nella navigazione, un personaggio con priorità 1 avrà la precedenza (passa prima) rispetto un personaggio con priorità 2

– NavMesh Walkable: quale ‘Navigation Layer’ può attraversare

4. Select the ‘hero’ and assign:

SimpleAgentScript.js


#pragma strict


        // Script to move a NavMeshAgent to the place where
        // the mouse is clicked.
	private var agent: NavMeshAgent;
	function Start () {
		agent = GetComponent.<NavMeshAgent>();
	}
	function Update () {
		var hit: RaycastHit;
		// When the mouse is clicked...	
		if (Input.GetMouseButtonDown(0)) {
			// If the click was on an object then set the agent's
			// destination to the point where the click occurred.
			var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
			
			if (Physics.Raycast(ray, hit)) {
				agent.SetDestination(hit.point);
			}
		}
	}

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Pathfinding – NavMesh Agent – Adventure – Point ‘n Click

3DS MAX – Skin

Skinnin Character

1. Select the mesh> MAIN TOP MENU> Modifier> Animation> Skin

2. Skin> Parameters> Bones: ‘Add’> select all the Biped objects

Edit Envelopes

3. Skin> Parameters> Edit Envelopes> Viewport> MOVE the envelope’s handles

Viewport> RMB over Envelop Yellow Line> Add Cross Section> LMB over Envelop Yellow Line to create a new Cross Section

Copy Envelope from left to right

Viewport> RMB over Envelop Yellow Line> Copy Envelope

Viewport> RMB over Envelop Yellow Line> Paste Envelope

Paint Weight

4. Skin> Parameters> Weight Properties> ‘Weight Table’> select Vertices> DRAG to change values

5. Skin> Parameters> Weight Properties> ‘Paint Weights’

Copy Weiight from left to right

6. Skin> Parameters> Mirror Parameters> ‘Mirror Mode’

By |3D Graphic, 3DS Max|Commenti disabilitati su 3DS MAX – Skin

Unity – Performance Test

Unity – Performance Test

Sometimes you need a benchmarks and system performance tests.

1. File> Open Project…> open your project
2. MAIN TOP MENU> Window> Profiler
3. MAIN TOP Play button to run the game

Now you can see inside Profiler Window:
– CPU Usage
– GPU Usage
– Rendering
– Memory
– Audio
– Physics
– Physics (2D)

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Performance Test

Unity 2D – Sprite Sheet Animation

Unity 2D – Sprite Sheet Animation

‘SpriteSheet’ is a larger image for combining multiple individual images into a single, efficiently laid out image.

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 2D – Sprite Sheet Animation