Answer by Kleptomaniac
Nobody here is giving you a clear answer. I would set out your script like so: #pragma strict var topdownCam : GameObject; private var cameraFollow: CameraFollow; private var planeSelfMove:...
View ArticleAnswer by Kleptomaniac
Ah, after reading your question a few more times, I think I've finally got it. The reason that this is happening is because you have *two* cameras, and you are changing the ShakeRotation on the camera...
View ArticleAnswer by Kleptomaniac
In order to randomly affect the x and y travel direction of your pellets, instead of having `Vector3(0, 0, speed) * Time.deltaTime`, try using [Random.Range][1]. So therefore:...
View ArticleAnswer by Kleptomaniac
This script is kind of a mess. Here is it cleaned up and optimised: //Got rid of ApplyDamage() here, because it seemed to bear no purpose var maxHealth : int = 100; //Typed these, as dynamic typing...
View ArticleAnswer by Kleptomaniac
I solved this a while ago by using LateUpdate() ... not sure if it is exactly a legitimate solution but it seems to work fine: function LateUpdate () { if (transform.rotation != Quaternion.Euler(0, 0,...
View ArticleAnswer by Kleptomaniac
The problem is that when you run you OnCollisionEnter() function, you call `Destroy(this.gameObject)` before you are even able to increment your score. This means it will not work as this script is...
View ArticleAnswer by Kleptomaniac
Do a tag check. For example: if (collision.gameObject.CompareTag("Target")) { Destroy(collision.gameObject); } This will only destroy objects tagged with the word "Target". Do the targets have a...
View ArticleAnswer by Kleptomaniac
I would suggest simply implementing a trigger collider for each section of the game in which you want to initiate dialogue. You can do this by simply setting up an empty GameObject with a Box Collider...
View ArticleAnswer by Kleptomaniac
You should really be using the [Event class][1] for event handling in OnGUI(), due to the fact that the OnGUI() function has multiple passes per frame and will thus repeat Input calls more times than...
View ArticleAnswer by Kleptomaniac
This means that an object reference had not been assigned to your orbs variable. Have you rechecked it in the Inspector to see that it hasn't lost your reference?
View Article