UnityNinja Community
Would you like to react to this message? Create an account in a few clicks or log in to continue.

UnityNinja CommunityLog in

UnityNinja - Video Game Development Community, including Resources, Forums, Marketplace & More.


TitanFall Like Robot Script

power_settings_newLogin to reply
4 posters

descriptionTitanFall Like Robot Script EmptyTitanFall Like Robot Script

more_horiz
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 Neutral
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

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
woops! Don't import this script! I still have to test

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
Alright! Fixed! There should be no problems.

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
BryceCain25 wrote:
Alright! Fixed! There should be no problems.
Uhhh...i should update this to where it spawns off of a transform..DANG IT!! Ow well..

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
Sure, I'll use this script. Thanks for the PM on it! I'll keep it until I make some animations like that.

EDIT: This is my 100th post!

Last edited by MusicKing7 on Sun Apr 06, 2014 5:56 pm; edited 1 time in total

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
MusicKing7 wrote:
Sure, I'll use this script. Thanks for the PM on it! I'll keep it until I make some animations like that.
Ok Smile I'm glad that you got the PM
it took me a long time to think through the script. I also made some other scripts in the scripts section today. Go check it out

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
thank you Very Happy , will be useful in the future, sorry if I write bad English but I am Italian Wink

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
developer23 wrote:
thank you Very Happy, will be useful in the future, sorry if I write bad English but I am Italian Wink
lol thanks Wink
Its totally ok! It doesn't matter how well you speak english as long as we communicate and learn programming, im fine Wink

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
Very Happy

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
BryceCain25 wrote:
developer23 wrote:
thank you Very Happy, will be useful in the future, sorry if I write bad English but I am Italian Wink

lol thanks Wink
Its totally ok! It doesn't matter how well you speak english as long as we communicate and learn programming, im fine Wink
Congrats on SuperMod Bryce!

descriptionTitanFall Like Robot Script EmptyRe: TitanFall Like Robot Script

more_horiz
privacy_tip Permissions in this forum:
You cannot reply to topics in this forum
power_settings_newLogin to reply