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 ArticleAnswer by cagezero
Is this what you are after? http://forum.unity3d.com/threads/86760-Hiding-default-transform-handles
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer by cagezero
1. Select the prefab in the Hierarchy 2. Unity Menu GameObject-> Break Prefab Instance
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer by cagezero
Have a look at the Unity Trail Renderer: http://docs.unity3d.com/Documentation/Components/class-TrailRenderer.html
View ArticleAnswer 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 ArticleAnswer by cagezero
Try this: private bool hasStarted = false; if(Input.GetKey(KeyCode.Space) || (hasStarted == true)) { transform.Translate(moveDirection * Speed * Time.deltaTime); hasStarted = true; }
View ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer 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 ArticleAnswer by cagezero
Have you tried OnCollisionEnter? http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnCollisionEnter.html
View Article
More Pages to Explore .....