Hello Everyone!
Today I have made a script that allows the basic script for a titan..now the following script will require some components, just look at the script and find them..
I did in fact make ALL of this script, no yelling..
Make sure you have a block animation, bullet animation and missile animation.
This will in fact switch cameras on button press, it will also disable the player. PLUS it will make a shake animation once entering the titan
This script took me a while to think out
anyways, if you would like to get a full project of this i will eventually make a full entire project detailing and instructing every line of code
Thank you for your support
-Bryce Cain 25
Last edited by BryceCain25 on Sun Apr 06, 2014 4:48 pm; edited 1 time in total
Today I have made a script that allows the basic script for a titan..now the following script will require some components, just look at the script and find them..
I did in fact make ALL of this script, no yelling..
Make sure you have a block animation, bullet animation and missile animation.
This will in fact switch cameras on button press, it will also disable the player. PLUS it will make a shake animation once entering the titan
This script took me a while to think out
anyways, if you would like to get a full project of this i will eventually make a full entire project detailing and instructing every line of code
Thank you for your support
-Bryce Cain 25
Code:
var spawnLocation : Vector3;
var missileanime : Animation;
var blockanime : Animation;
var hitanime : Animation;
var maincamera : Camera;
var titancamera : Camera;
var shakeanime : Animation;
var character : CharacterController;
function Start () {
character.GetComponent(CharacterController);
}
function Update () {
if(Input.GetMouseButtonDown(1)) {
hitanime.Play();
Instantiate(prefabToSpawn, spawnLocation, Quaternion.identity);
Debug.Log("Hit animation played..");
}
if(Input.GetMouseButtonDown(2)) {
blockanime.Play();
Debug.Log("Block Anime Played");
}
if(Input.GetMouseButtonDown(0)) {
missileanime.Play();
Debug.Log("Played Missile Anime");
}
}
function OnTriggerEnter () {
shakeanime.Play();
character.enabled = false;
maincamera.enabled = false;
titancamera.enabled = true;
}
Last edited by BryceCain25 on Sun Apr 06, 2014 4:48 pm; edited 1 time in total