Quantcast
Channel: Answers by "cagezero"
Browsing all 60 articles
Browse latest View live

Answer by cagezero

http://docs.unity3d.com/Documentation/ScriptReference/GameObject.CreatePrimitive.html http://docs.unity3d.com/Documentation/ScriptReference/Object.Destroy.html Did you try searching at all before you...

View Article



Answer by cagezero

Is this what you are after? http://forum.unity3d.com/threads/86760-Hiding-default-transform-handles

View Article

Answer by cagezero

Unity 4 made some pretty serious changes to the way game object active/inactive is handled. If you look, the children are actually still active, however they will report inactive in hierarchy, making...

View Article

Answer by cagezero

The Application function you are calling can't be used that way. http://docs.unity3d.com/Documentation/ScriptReference/Application-isPlaying.html Instead try using...

View Article

Answer by cagezero

There are a lot of ways you can accomplish what you want. I will go over two of them. **Option 1:** Put your loop into a corotuine with this kind of logic (pseudo code): IEnumerator CreateObjects() {...

View Article


Answer by cagezero

1. Select the prefab in the Hierarchy 2. Unity Menu GameObject-> Break Prefab Instance

View Article

Answer by cagezero

Static method calls vs instance method calls are almost identical as far as CPU cycles are concerned. Worrying about the difference is certainly not worth your time at this point. OnGUI is infinitely...

View Article

Answer by cagezero

function OnGUI() { if (distance = 70) GUI.Button(Rect(200,180,510,120),"Thank you!"); else GUI.Button(Rect(200,180,510,120),"Hello Player! Will you pls collect 70 energy for me?"); } }

View Article


Answer by cagezero

For a discussion on floating point precision check out this answer: http://answers.unity3d.com/questions/50187/floating-point-accuracy-weirdness.html For understanding how to deal with the difference...

View Article


Answer by cagezero

You could create a wrapper class that encapsulates all the data you need to send. Something like this: //The Wrapper class public class Wrapper { public GameObject build; public Vector3 position;...

View Article

Answer by cagezero

There are multiple ways of accomplishing this. Try starting by researching these GUI classes: http://docs.unity3d.com/Documentation/ScriptReference/GUI.Label.html...

View Article

Answer by cagezero

Have a look at the Unity Trail Renderer: http://docs.unity3d.com/Documentation/Components/class-TrailRenderer.html

View Article

Answer by cagezero

You are using target = GameObject.FindWithTag ("Enemy"); To acquire the EnemyFighter. However, EnemyFighter has a child object also tagged "Enemy". According to the docs FindWithTag "Returns one active...

View Article


Answer by cagezero

Try this: private bool hasStarted = false; if(Input.GetKey(KeyCode.Space) || (hasStarted == true)) { transform.Translate(moveDirection * Speed * Time.deltaTime); hasStarted = true; }

View Article

Answer by cagezero

I assume that you are destroying the laser when it collides with the asteroid. If so, try destroying the laser with Destroy(object, delay);

View Article


Answer by cagezero

I do not use javascript much, but here is the barebones idea: public var enemy : GameObject; function Start () { yield WaitForSeconds(300); InvokeRepeating("SpawnEnemy", 3, 3); } function SpawnEnemy()...

View Article

Answer by cagezero

I have made a few suggestions to relevant code below that should help with spawning the asteroids after the spawnInterval and destroying the object. If you are having any other specific problems please...

View Article


Answer by cagezero

Without spending too much time on it, here is a simple example of how you might do this. Check the Update function in the Animal script for the meat of the action. 1) In an empty scene, create two...

View Article

Answer by cagezero

Use Physics.SphereCast. Set the radius to be your auto aim error, distance to be the range of your turret. //Ray should be configured with the turrets position and whatever //direction it is currently...

View Article

Answer by cagezero

Have you tried OnCollisionEnter? http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnCollisionEnter.html

View Article
Browsing all 60 articles
Browse latest View live




Latest Images