Quantcast
Browsing all 90 articles
Browse latest View live

Answer by Kleptomaniac

Here's how. Just use an array of materials and cycle through them with each successive mouse click. Then apply your newly chosen material to your mesh and your good! So like this: var matArray :...

View Article


Answer by Kleptomaniac

Yes, this is because of the structure of arrays. Let me explain. Say you were to have an array of ints called intArray which contains [5, 10, 15, 20, 25, 30, 35]. The way in which array elements are...

View Article


Answer by Kleptomaniac

This is easy to implement. Add all your FPC's to a built in GameObject array in the inspector: `public GameObject[] charInst;`. Depending on how you want your GUI button layout to be, you can link an...

View Article

Answer by Kleptomaniac

Hey there, All you need to do is store your ID within tags assigned to your individual GameObjects like so: `gameObject.tag = ID;` and then use [GameObject.FindGameObjectsWithTag()][1] to find your...

View Article

Answer by Kleptomaniac

It means that EtceteraManager.cs is referencing the class AbstractManager, however AbstractManager doesn't exist for some reason or another. It's likely that the AbstractManager script is either...

View Article


Answer by Kleptomaniac

Hey there, Although you have failed to present any code (which makes helping you that much harder) I can give you a generalised answer. All you need to do is base your GUI rendering on a boolean...

View Article

Answer by Kleptomaniac

This is not the correct way to format that conditional. Unless I'm mistaken, the only syntactically correct way to accomplish what you want is like this: if (Vector3.Distance(playerTransform.position,...

View Article

Answer by Kleptomaniac

Hey there, Not super sure what you're asking here, but I'll give it a crack. Do you just want to make it so you can open the gate with an arbitrary number of keys as opposed to just E? if...

View Article


Answer by Kleptomaniac

Hey, Having read your last comment, I believe I understand what you want now. Try using [Quaternion.Lerp][1]: float maxRot = 45.0f; //Max neg and pos strafe rotation value float rate = 2.0f; //Rate of...

View Article


Answer by Kleptomaniac

Hey there, You're going about this the wrong way. Instead of hard-coding your gun to follow the rotation of the camera, all you need to do is parent you gun GameObject to your camera. You can do this...

View Article

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 Article

Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article


Answer 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 Article

Answer 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 Article

Answer 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
Browsing all 90 articles
Browse latest View live