Answer by Daniel 6
One issue I noticed is that you are declaring your VisibleThings and InvisibleThings arrays incorrectly. Change the ":" to an "=" sign.
View ArticleAnswer by Daniel 6
Move your script (InitTerrain) out of the standard assets. But leave the MultiDim script in there because it needs to compile first.
View ArticleAnswer by Daniel 6
Here's an example on how to create a simple button in Unity:function OnGUI () { if (GUILayout.Button ("Load Level 1")) { // Do your load code here. I'm assuming Application.LoadLevel (); } }
View ArticleAnswer by Daniel 6
You are having your static variables reference a non-static variable. You can not do this; static variables can only access other static variables.
View ArticleAnswer by Daniel 6
It is possible to scale a GUITexture by changing it's pixelInset variable. Here's a sample:guiTexture.pixelInset.width += 20;
View ArticleAnswer by Daniel 6
To prevent object's from going through each other, you could just decrease the fixedTimeStep in the physics settings (Edit->ProjectSettings->Physics).
View ArticleAnswer by Daniel 6
There is the method Input.GetMouseButtonUp(). This is how it's used:function Update () { if (Input.GetMouseButtonoUp (0)) { // This will be executed when the mouse button was released. } }Or if you...
View ArticleAnswer by Daniel 6
It appears that some of the normals are flipped in unity. Are you sure that the normals are facing the correct direction in blender? Because maybe your normals are incorrect in blender as well, just...
View ArticleAnswer by Daniel 6
One way to do it is to set the animations speed through code. Like this:function Start () { animation ["animation name"].speed = 0.1; }
View ArticleAnswer by Daniel 6
try this:function OnCollisionEnter ( collision : Collision) { if (collision.collider.name == "Player") Destroy (GameObject.Find("Player")); } Your code was checking if an object (called "Player") even...
View ArticleAnswer by Daniel 6
If you want to define a prefab, write the following line at the top of your script:var prefabToCreate : GameObject;
View ArticleAnswer by Daniel 6
Yes, you would use the "else" keyword. It will be called when the "if" condition is false.if (condition) { } else { }
View ArticleAnswer by Daniel 6
ParticleEmitter.particles returns an array of the particles. According to the docs, you need to store ParticleEmitter.particles into a variable, modify that variable, then set this variable to...
View ArticleAnswer by Daniel 6
I would recommend purchasing the Prime31 iAd plugin. Here's the link:http://www.prime31.com/unity/
View ArticleAnswer by Daniel 6
Texture2D.Resize() does not cleanly shrink/grow an image like you are expecting it to. In the docs it says that pixels become undefined after calling this function....
View ArticleAnswer by Daniel 6
Yields and coroutines can only be defined in a class deriving from MonoBehaviour. So you have to make Test derive from MonoBehaviour and place that onto a GameObject. But the while-loop should work...
View ArticleAnswer by Daniel 6
One solution that will most likely fix the problem is decreasing the FixedTimeStep (Edit->ProjectSettings->Time). Try 0.01 for instance. It's hard to say precisely what the problem is from just...
View ArticleAnswer by Daniel 6
Here's one approach. I haven't compiled the code so not sure if it contains spelling errors. var colorA : Color; var colorB : Color; function DoLerp (duration : float) { var startTime = Time.time;...
View ArticleAnswer by Daniel 6
Not sure of the answer, but it wouldn't hurt to use the latest version of Unity. Any reason your not using 3.4.2?
View ArticleAnswer by Daniel 6
Change the main matrix of the GUI class. I usually use GUIUtility.ScaleAroundPivot () for my scaling.
View ArticleAnswer by Daniel 6
Reduce fixed time step (Edit/Project Settings/Time) until the collision is detected.
View Article
More Pages to Explore .....