Video Games Development

Unity 3D – Character Controller – Standard Assets

Unity 3D – Character Controller – Standard Assets

1. MAIN TOP MENU> Assets> Import Package> Character Controller

2. Project> Standard Assets> Character Controllers>

– 3rd Person Controller
Trird Person Controller (Script)
Idle Animation (Animation Clip)
Walk Animation (Animation Clip)
Run Animation (Animation Clip)
Jump Animation (Animation Clip)

– First Person Controller
Character Motor
Movement
Jumping
Moving Platform
Sliding

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Character Controller – Standard Assets

Unity – Build – Web Player

Unity – Build – Web Player

0. MAIN TOP MENU> File> Buil Settings> Select Web Player

1. MAIN TOP MENU> File> Buil Settings> ‘Player Settings’> Inspector to setup

2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Scenes in Build> DRAG AND DROP the _Scenes> YourScene

3. 2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Create Folder ‘Builds/space_shooter’> Save

Web Player Streaming

1. MAIN TOP MENU> File> Buil Settings> check ‘Streamed’
2. MAIN TOP MENU> File> Buil Settings>’Player Settings’> Inspector> Other Settings> First Streamed Level

Advantage:

1. If there is a fast download of the first level you will not see the loader progress bar
2. Not annoing download time improves web gaming experience for the end user

This is the best way:

50 KB display the logo and menu (4 seconds)
320 KB let the user play a tiny tutorial level or let him do some fun interaction in the menu (20 seconds)
800 KB let the user play the first small level (50 seconds)
Finish downloading the entire game within 1-5 MB (1-5 minutes)

There is no reason why all music must be available when the game starts. Externalize the music and load it via the WWW class

Reference:
http://docs.unity3d.com/Documentation/Manual/WebPlayerStreaming.html

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Build – Web Player

Unity – Build – Flash Player

Unity – Build – Flash Player

0. MAIN TOP MENU> File> Buil Settings> Select Flash

1. MAIN TOP MENU> File> Buil Settings> ‘Player Settings’> Inspector to setup

2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Scenes in Build> DRAG AND DROP the _Scenes> YourScene

3. 2. MAIN TOP MENU> File> Buil Settings> ‘Build’> Create Folder ‘Builds/space_shooter’> Save

WARNING: Development Build it is not compressed!

Errors

‘Error building Player: Exception: Could not start java’ you need to install 32-bit JRE:

1. Download: http://www.oracle.com/technetwork/java/javase/downloads/java-se-jre-7-download-432155.html

2. For Win7 64bit is: jre-7-windows-i586.exe (it is 32 bit jre because Unity is 32 bit!)

3. Run the installer as Administrator

By |Unity3D, Video Games Development|Commenti disabilitati su Unity – Build – Flash Player

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

Unity 3D – Pathfinding – NavMesh Obstacles

Unity 3D – Pathfinding – NavMesh Obstacles

These items are not baked into the NavMesh, and thus can move around freely while getting in the way.
Questi ostacoli non possono essere attraversati dal’agente, non sono calcolati nel NavMesh e si possono muovere liberamente nella scena.

1. Create a NavMesh
2. Create a ‘targetNavigation’ object
3. Create a NavMeshAgent

4. Create a game object and name it ‘moving obstacle’

Select ‘moving obstacle’ Inspector> ‘Add component’> Navigation> Nav Mesh Obstacle setup

– Radius: radius of the obstacle collider
– Height: height of ther obstacle collider
– Move Threshold (soglia):
– Carve (intagliare):

By |Unity3D, Video Games Development|Commenti disabilitati su Unity 3D – Pathfinding – NavMesh Obstacles