Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » FREE Project Downloads & Recources » Scripts » Supplies Script

Supplies Script

View previous topic View next topic Go down  Message [Page 1 of 1]

1 Supplies Script on Thu Oct 02, 2014 9:46 pm


Hello! Welcome to the Supplies Script...
This script will manage supplies total gathered...and the ammount you need to spawn..

Let's start by doing this:
First make a JavaScript file..

var supint : int;
var supgo : GameObject;
var supplayer : Transform;
var supmax : int;
var customtag : String;
function Start () {
supint = 0;

function Update () {
if(supint ==  supmax && Input.GetKeyDown(KeyCode.F1)) {
Instantiate(supgo, supplayer.position, supplayer.rotation);
function OnTriggerStay () {
if(supplayer.gameObject.tag == customtag) {
Debug.Log("Current int =" + supint);
this will allow you to use custom tags and custom everything, this is a base script...

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum