Questions tagged [gameobject]

GameObject is a key component of the Unity3D engine. It is often associated with Unity3D questions.

GameObject is a key component of the Unity3D engine. It is often used in the engine when developing games and apps. It can be added to a Unity scene to represent and control many game elements such as UI, audio, effects, lighting and various objects. The GameObject can have multiple components added to it, including a script to control its behavior and attributes.

708 questions
0
votes
1 answer

Does adding many game GameObjects in scene (not rendered) inefficient for performance? [Unity]

I'm using Unity 4.6 to develop a 2D game. I want to know if having a lot of GameObjects in the scene (out of the camera's sight) has a considerable influence on performance. For example, is it efficient to make an scrollable list of names (like…
0
votes
1 answer

Resize gameObject when it has extended a restricted area

So here i have an image will provide a better understanding of my problem. So currently i have some white blocks and within the white blocks i have some cyan bordered boxes. So the current problem i want to solve now is. Whenever the white boxes are…
JekasG
  • 135
  • 11
0
votes
3 answers

How to get array of child objects contained in a GameObject

I have a GameObject in Unity that is supposed to serve as a container for some definitions. I'd like to access that object and retrieve the Def class instances (every object there is instance of Def general class). So, if I have a GameObject…
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
0 answers

unity add an object as a child

I have a moving object containing some objects. When i'm creating some of the child objects and setting the parent to parent object, the created object does not move with parent. I checked the hierarchy panel. but the created objects are not in the…
Person
  • 345
  • 2
  • 4
  • 11
0
votes
1 answer

Spawning coins randomly in an infinite runner 3d game

I have a 3d infinite runner car racing type game in which the player is stationary and the background moves. In my game I want to spawn coins randomly over time and the coins has to be spawned very much ahead of the player, and the z axis of the…
njnjnj
  • 978
  • 4
  • 23
  • 58
0
votes
0 answers

Delete duplicate gameobject on restart

I have the following code which creates a main menu : public class EscapeGUI : MonoBehaviour { public GUISkin MySkin; public bool pauseToggle = false; public bool showGUI = false; public bool levelLoaded = false; static string filePath; …
Dennis
  • 3,044
  • 2
  • 33
  • 52
0
votes
1 answer

Unity track object rotation

I have several object rotating by itself in FixedUpdate(). Now I need to track rotation of one object, lets call it objX. Rotation goes only from 0 to 360 when I retrieve it. Is it possible to get rotation after 360 degrees? For example when I use…
filipst
  • 1,547
  • 1
  • 30
  • 55
0
votes
1 answer

How to instantiate object class that contains GameObject?

I am attempting to instantiate a large number of "particles" using a C# script in Unity. I have created a particle class that contains the creation of a corresponding GameObject. The GameObject within each particle instance is a sphere. When…
0
votes
1 answer

Changing the speed of a gameobject

I am making an object move continuously and the code for that is: myRenderer = gameObject.GetComponent(); speed_target = Random.Range (15, 20); rigidbody.velocity = transform.right * speed_target; I have another gameobject which…
venkat
  • 11
  • 1
0
votes
1 answer

How to scroll progressively a game object?

I am developing a game with Unity which has a main menu to allow the user select game mode. In this screenshot you can see an example: My problem is the following: I need to create a scroll in which user can put his finger on point 1 and…
user2528167
0
votes
3 answers

Simplest way to iterate over all GameObject childrens from a script at runtime

In my Unity3D project I got a complex GameObject of a truck that his hierarchy looks like this. + Truck +FrontPivotPoint +LeftWheel Tire Rim Hindge +RightWheel Tire Rim Hindge …
orthehelper
  • 4,009
  • 10
  • 40
  • 67
0
votes
1 answer

gameObject turns into an Object when transferred to an Array

I'm new to Unity. I have an array of GameObjects which I declared using var shades:GameObject[]; Now, I had to convert this to an Array using var allShades =new Array(shades); but it seems like the gameObjects have turned in Objects because I can…
Rian
  • 171
  • 16
0
votes
1 answer

unity Destroy instantiated GameObject

i want to destroy a game object that i instantiated and i get a lot of errors when i try to do so like "the name clone does not exist in the current context" , "cannot convert object expression to type UnityEngine.Object". i tried a lot of things i…
0
votes
0 answers

Unity3d Can I search gameobject around my character with a certain range?

I googled what I am curious about, and didn't find anything yet. I have my character (0, 0, 0) and enemy units are generated at random position. And I will automatically move my character by press auto button. While moving, begin attacking enemies…
Phiru
  • 39
  • 1
  • 8
0
votes
2 answers

Unity3D threads and GameObjects

I have an application within Unity3D (acting as a server) that receives messages from an exterior application (single client) with the following structure: number(float) number(float) number(float) The first two numbers represent the local position…
user3019217
  • 335
  • 1
  • 5
  • 12