Posted on and Updated on

Animation ⁄ Week 6 ⁄ Unity

Download

For this assignment, I decided to use Fuse’s doctor outfits to create characters for a hospital scene. Two surgeons fail to save a life, at which point they decide to escape the situation by breaking into spontaneous dance. The two doctors are rigged with confused or worried animations followed by dances. The patient is rigged with a seizure animation. The scene is composed of some Unity primitives with some tile textures I found on Google images, and some free furniture I found on Turbosquid. The music is some classic Dance Mania ghetto house pulled from this youtube video and cut into a new track with a heart monitor sound effect I found online. The colored spotlights and the “DANCE IT OFF” text are all rigged with similar timer scripts which tell them to appear after a certain number of seconds have passed after the app was launched. Here’s the script that tells the spotlights when to activate:

using UnityEngine;
using System.Collections;

public class lights : MonoBehaviour {

	bool waitActive = false; //so wait function wouldn't be called many times per frame

	private Light light;

	// Use this for initialization
	void Start () {
		light = GetComponent<Light>();
		light.enabled = false;
	}

	// Update is called once per frame
	void Update () {

		if (!waitActive) {
			StartCoroutine (Wait ());   
		} else {
			light.enabled = true;
		}
	}

	IEnumerator Wait(){
		yield return new WaitForSeconds (7.0f);
		//		waitActive = false;
		waitActive = true;
	}
}

Essentially the code says “after 7 seconds have passed, set the “enabled” option on the Light object to true“.

I also set the application to automatically quit after a certain period of time using another script which calls `Application.Quit()` after 18 seconds.

Leave a Reply

Your email address will not be published. Required fields are marked *