A game object is any object in a game that the player can see and/or interact with. The player object, power ups, enemies, platforms, walls, weapons (if collision detection is considered) and projectiles are all game objects.

learn more… | top users | synonyms

8
votes
8answers
1k views

I am looking for a word to classify Game Objects (Trees, Rocks, even Bridges) but NOT include Items/Characters [closed]

I am looking for a SPECIFIC definition that includes environmental game objects but NOT other game objects. Trees, Rocks, or even Bridges. NOT items, NOT weapons, NOT Characters, NOT tiles. I'm ...
5
votes
4answers
529 views

Recursive or linear gameobjects update?

I have a tree of gameobjects, so every node contains a list of children. In update function: Is it better to do recursive or linear walking through game objects. update() { update self; ...
5
votes
2answers
787 views

Best way to keep track of game objects

I'm not exactly sure how I should ask this question, and so the title may be misleading - I am not asking if I should use a list or a stack or a vector or a queue - but how I should go about keeping ...
4
votes
2answers
316 views

Open World Object Management

I'm currently creating a system that essentially creates a world at run-time based on a seed I choose. In this system, I made it so that there are certain "chunks" that divide up different sections of ...
3
votes
4answers
264 views

How to enter a level when touching an object

I am working on a project in Unity 4.6.1f1 and I was wondering how can I make a cube touch another cube to go to the next level (the image below)? ! EDIT: I made a script and put it on the purple ...
3
votes
1answer
491 views

Component-based object, traversal?

I'm working on a small C++ component based game engine, as such... Object Foo might extend GameObject and x number of component interfaces, like Renderable and/or Physical. So let's assume that Foo ...
3
votes
1answer
39 views

Unity - C# - Overlapping Rectangles not separating

I am Instantiating a lot of Rectangles of different sizes (ranging from 3 to 18 units) and they all have attached this script, which should cycle through all the GameObject List which contains them. ...
3
votes
1answer
175 views

How to make an object stay relative to another object

In the following example there is a guy and a boat. They have both a position, orientation and velocity. The guy is standing on the shore and would like to board. He changes his position so he is ...
3
votes
2answers
2k 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 ...
3
votes
3answers
1k 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 ...
2
votes
3answers
89 views

What are the differences between using “GetComponent<Transform>()” and this.transform?

I've been reading some example codes and working on my own stuff in Unity. I've been seeing a lot of GetComponent, and often this will be done for the transform: Transform _transform = ...
2
votes
2answers
457 views

How do I save and restore an int value with PlayerPrefs?

I am stuck on how to save the player's amount of money. When I build the game in the exe as soon as I shutdown the game my money value gets lost. I want this money to be saved. I am using the ...
2
votes
3answers
801 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). ...
2
votes
2answers
172 views

How to apply a script to multiple Objects in Unity?

In Unity, I've almost 200 or more objects. I wish to apply single script to all those objects. I'm a beginner & learning scripts in Unity. Edit: At the time of editing the scene itself.
2
votes
2answers
178 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 ...
2
votes
1answer
205 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 ...
2
votes
2answers
218 views

How do I make an equipped item affect the equipper?

I'm making a small text-based adventure in Objective-C. I have a Player class with four properties which represent the player's attributes (strength, agility, stamina, and intelligence). I also have a ...
2
votes
1answer
291 views

Get object length and width divided by two?

I have googled and found a script for the following task; Make the camera move to touched position. However, this script will jump to x and y positions on an object, while i would like for it to move ...
2
votes
2answers
1k 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 ...
2
votes
2answers
112 views

Destroying object from object method

My game uses an entity manager and entities to represent everything including the player, enemes, items, ..everything in the game. In my engine it's the responsibility of every entity to update ...
2
votes
1answer
1k 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 ...
1
vote
1answer
575 views

Game-components and memory management

I'm stitching together the workings of a component based game engine, and as such have been deeply reading into many aspects of both game engine architecture and a fair amount of opinionated theory of ...
1
vote
1answer
219 views

When to use an Array vs When to use a Vector, when dealing with GameObjects?

I understand that from other answers, Arrays and Vectors are the best choices. Many on SE claim that Linked Lists and Maps are bad for video game programming. I understand that for the most part, I ...
1
vote
1answer
407 views

Destroying Unity GameObject when it goes out of camera during runtime

I have this GameObject instanciated in unity - void Start () { GameObject myRoadInstance = Instantiate(Resources.Load("car"), new Vector3(5, 5, 5), ...
1
vote
2answers
4k 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
vote
1answer
39 views

Unity3D - GameObject as a static function

Newbie Unity3D/C# developer here. I've tried learning Unity3D during my May/June college vacation and came across a problem:Code 1: CameraObj returnVoid; void Start () { returnVoid = ...
1
vote
2answers
80 views

Accessing a newly Instantiated Object

I currently am creating a script that allows the player character to attack by shooting orbs at foes. I have the current code to do that (not final code, for testing purposes): ...
1
vote
2answers
155 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 ...
1
vote
1answer
1k 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 ...
1
vote
2answers
230 views

Best way to store a large amount of game objects and update the ones onscreen

Good afternoon guys! I'm a young beginner game developer working on my first large scale game project and I've run into a situation where I'm not quite sure what the best solution may be (if there is ...
1
vote
2answers
185 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
1
vote
1answer
168 views

Making specific Enemy Classes

So I was just looking through an old game I had made for android, and was second guessing how I was sub-classing enemy for each particular enemy in my game. My enemy class had all kinds of ...
1
vote
1answer
560 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 ...
1
vote
1answer
98 views

How to move objects in any direction by swiping with libgdx android game development

first of, I'm new to android game development so I don't know all the classes and dictionaries within android and libgdx. I'm actually following a game development tutorial for the first time ...
1
vote
1answer
275 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
2answers
250 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 ...
1
vote
0answers
108 views

How do I avoid circular dependencies with game events in C++? [closed]

My question concerns three objects in my game: EnemyConfig (a derived class of Event - it's an event that concerns throwing enemies at the player and making her deal with them) and Enemy. The ...
1
vote
1answer
215 views

Structure gameobjects and call events

I'm working on a 2D tile based game in which the player interacts with other game objects (chests, AI, Doors, Houses etc...). The entire map will be stored in a file which I can read. When loading the ...
1
vote
3answers
730 views

How to deal with characters picking up and dropping objects in a 2D game [duplicate]

I'm quite new to game development, so would like to get a consensus on methods of doing this. My game features a 2D character that is able to pick up and drop objects, for example, a stick. My ...
0
votes
4answers
244 views

Actor and Sprite, who should own these properties?

I'm writing sort of a 2D game engine for making the process of creating games easier. It has two classes, Actor and Sprite. Actor is used for interactive elements (the player, enemies, bullets, a ...
0
votes
2answers
48 views

Questions about property-centric game object runtime

I was reading Game Engine Architecture by Jason Gregory So according to him, I should use an array of entities, and arrays for each property, such as an array gameObjectsPosition, ...
0
votes
2answers
163 views

How can I handle merging and splitting lots in a city block? [closed]

I am currently working on a SimCity-style game in C# using SharpDX. I'm having trouble handling the growing and shrinking the game entities that represent zones within a region. For example: ...
0
votes
1answer
38 views

Design Pattern for “Default Object”

I'm making a first person dungeon crawler like Eye of the Beholder. During execution, I have a Map object. It contains Cell objects. Anc each Cell contains, at most, four Wall objects. The Wall ...
0
votes
1answer
28 views

Unity 2d - Destroying foreign object from script + seek explanation about destroying objects

I have simple emmiter which sending enemies toward player in center of screen. Player can shoot missile (also emmiter). I want to destroy enemy AND missile in same time. Here is my code attached to ...
0
votes
1answer
47 views

Check if is object in camera field and not covered by other object

I know how to check if object is in camera view but how I can check if that object is cover by something elese? In my case I want to turn on or off some effect when I look at light. At this moment my ...
0
votes
2answers
44 views

Refer to a gameobject on start

So I want my script to set the initial position of an object depending on the size of the screen and whatever. How do I refer to the gameobject? I know you can modify stuff like their location if the ...
0
votes
1answer
157 views

Help with understanding “transform.root.GetComponent<>” in Unity

I'm reading through a tutorial for making an RTS in Unity, and in certain scripts it wants you to make a Player field and then OnStart(){ transform.root.GetComponent}. I am not quite getting what that ...
0
votes
1answer
94 views

Unable to instantiate objects Straight in unity

I am creating a match card game in unity and I want to place cards in straight direction that is one below another and so on... But with my formula It's showing cards one after another.Please tell me ...
0
votes
1answer
141 views

Assigning multiple game objects to a single sprite (Unity)

I've been making a pokemon game clone on my own with Unity, as I'm a beginner and just trying to learn. Up until now I've been splicing the town pictures and manually putting them together, but this ...
0
votes
1answer
265 views

How can I edit the components of an instantiated prefab?

Is it possible to edit one or more components of an instantiated prefab ? For example if you instantiated five cube prefabs. Is it possible to reference each of the cube prefab and change a value ...