2
votes
1answer
52 views

How can I access a script variable from another script in Unity?

I'm creating a space shooter (think Space Invaders or Galaga) where the GameManager persists between scenes but the player and enemies don't. I need to access a boolean value from the player and ...
2
votes
3answers
138 views

How do I check whether a camera has unobstructed view of a GameObject?

I want to check if a GameObject is visible to the camera. The renderer.isVisible-method only checks if the camera is turned towards the object, not if there is anything between them (like a wall). ...
1
vote
2answers
91 views

Trying to better understand Unity gameobjects

New to Unity, but develop in C# normally. I can't seem to get how / why / where to grab certain elements. For simplicity, I have a top-level game object, say a cube. I add a sphere to the scene as ...
0
votes
1answer
81 views

Moving gameobject with animation according to my script Unity3D

I am developing a game with Unity3D with an horizontal list of elements which you can move with arrows. Here you can see an example: I have created animations in order to modify the alpha value of ...
-1
votes
2answers
143 views

How to stop a object with progress bar so it can start instantly in unity [closed]

I have created a gameobject(cube) and written code to move,mean while the processbar get loading.when the processbar is loaded fully then the object should stop moving.Can anybody please help me ...
0
votes
1answer
125 views

How do I detect a destroyed object in Unity?

I have an object in unity which is spawn through a script. Upon detecting that the object has taken substantial damage, objectDestroy is called and the object is removed. However, I would like for a ...
0
votes
1answer
398 views

How to enable/ disable GameObject

I have child object with ParticleSystem component. I want to have particles disabled until I press button. I unchecked child object to make it disabled but when I press play it enables ...
1
vote
1answer
90 views

collision in different layer

I have a game object called game object 1 on screen. It holds an image called red . when i drag an image called "animal" on a game object 1 collision happening fine and destroys the "animal" in same ...
0
votes
1answer
118 views

Game object position issue in unity3d

I have a set of objects placed on the same layer where all the objects are invisible except one .When i drag an object in to a selected area the current dragged object get destroyed and the object ...
1
vote
2answers
370 views

Drag an object in unity3d

I want to drag an object to a perticular place.In case I release that dragged object before I reach that particular area ,the object should come to its initial place where i start to drag. How it ...
-1
votes
1answer
177 views

Disabling / Enabling object renderers on click

I am working on unity2d. I have six game objects: Object1, Object2, Object3 (these are images) ObjectImage1, ObjectImage2, ObjectImage3 (these are images). I have arranged the object in the scene ...
2
votes
2answers
114 views

Do I have to use new keyword for unity single game object?

I'm using Unity4. Do I have to use new keyword for single game object? look at the following code. 1. GameObject obj = new GameObject(); obj = Resources.Load("Prefabs/Ball", typeof(GameObject)) as ...
1
vote
2answers
109 views

Unity3d - Monitoring which script is bound to which gameobject

How can we see the bounded scripts to gameobjects ? In a large project, it's hard to keep up monitoring by clicking each game object to see bounded scripts
3
votes
2answers
531 views

How can I create an array of GameObjects?

I need to add one 2d assest multiple times in my scene and I was wondering what is the best way to do this because adding each asset individually and setting there locations doesent seem like the best ...
2
votes
1answer
148 views

At same positioned game objects collision detection

In my game, I am creating two game objects at same position using Instantiate statement. Each generated object has box collider attached. So I want to detect collision between them so I write ...
3
votes
2answers
827 views

Unity 4 - Some Rigidbodies Won't Fall Asleep

I'm having this problem in the free edition of Unity 4.1 where rigidbodies aren't falling asleep (and yes, I've tried playing with the sleepVelocity and sleepAngularVelocity values!). I've read the ...
1
vote
1answer
631 views

How can I create an extending chain like the hookshot in Zelda in Unity?

In the Zelda games, there is an item called the hookshot. It is a small mechanical apparatus held in one hand that acts similar to, but not the same as the gun. When it is triggered, the hook at the ...
1
vote
1answer
221 views

Spawning enemies at way points [closed]

I'm trying to have my game spawn enemies when ever the player reaches a way point. Right now, I have this functionality working. When my player gets to the first way, the enemies spawn. He only moves ...
1
vote
1answer
445 views

Unity3d select empty gameobjects in scene

I have a pathing system that I am creating in Unity. When you add nodes to denote the path, I create a empty GameObject and render it in OnGUI as a square. The problem that I have is clicking on the ...
0
votes
2answers
2k views

Unity scaling instantiated GameObject at Start() doesn't “keep”

I have a very simple scenario: A box-like Prefab which is imported from Blender automatically (I have the .blend file in the Assets folder). A script that has two public GameObject fields. In one I ...
0
votes
1answer
1k views

How to get GameElements (RigidBody) size in Unity

I've made a prefab consisting of a Cube which I've first scaled to more resemble a brick. There's also a Rigidbody added to the cube (in the prefab). Now I want to use that prefab in a c# script to ...