Skip to main content

Posts

Showing posts with the label script

Collision/Trigger

An overview of how to use OnCollision and OnTrigger functions. Which almost all games have. Ha..

Referencing another script..

So, here's how it's done. function addingExp(){     var level = gameObject.Find("Player").GetComponent(Level);     level.experience +=50; } Explanation: gameObject.Find("Player")  Finds the object the script it attached to. Player is the name of the object, note that the name has to be in quotations. GetComponent(Level) Finds the name of the script. level.experience +=50; level is calling the variable that we just set above, experience is a variable within the script that were calling on in the code.

Making Classes..

A dip into JavaScript. Before I begin. var is a variable. You need to declare your variables before you start writing code so the code will execute properly. Declaring a function goes like this: function Update(){ //Insert your code here.... }

First Blog...

Well, its going to be about creating games on Unity . I am relatively new to the interface and JavaScript. But I have gotten used to it through great tutorials and scripting references . I am going to be developing a simple (or at least at first.) video game, and keeping track of it on this blog here. Unless your at least relatively familial with Unity, you might want to watch all the tutorials (Yes I know its alot) to understand exactly what I am talking about.