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

1
vote
2answers
164 views

Determine facing direction mecanim 2d movement

I'm using this script to move my character in my 2d world: public float speed; //Movementspeed public Rigidbody2D rbody; Animator anim; void Start () { rbody = GetComponentInChildren<...
0
votes
2answers
142 views

Where should I save game object's attributes (hp, score) in Swift?

Scenario: I have a game with several game objects on screen. Each can have different score and hitpoints. When I use collision detection for cannonball vs. ship (example) I need to know which ship is ...
-1
votes
2answers
2k views

How to enable and disable scripts on a Game Object?

This worked briefly yesterday, I believe I did something to mess this up. All my inputs that I put in are correct; therefor, it must be the code. I want to switch players. While the red cube's script ...
1
vote
1answer
339 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 ...
0
votes
1answer
31 views

How do you play more than one animation at a time in unity

I am trying to have 2 animations on one GameObject and i want them to play at the same time. I have been looking all over and messing around with the animator controller but i cant get it working.
0
votes
1answer
58 views

Blender assets management and workflow for Unity project

I'm trying to decide how to manage my 3D assets, and even how I should construct a world for my game. I should maybe explain, my game is basically a single explorable world set in a school. It's ...
0
votes
1answer
87 views

Collision between UI element and GameObject

When I first started to develop in Unity I followed the Unity Tutorial for the Space Shooter 2D game and used the knowledge from that to create something myself. Looking at it now it may not have been ...
0
votes
1answer
667 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 into a selected area, the current dragged object gets destroyed, and the object ...
0
votes
0answers
9 views

MeshRenderer.sharedMaterial does not change twice

Hi I was changing material from an object and using this code that's working well: MeshRenderer renderer = tile.GetComponent<MeshRenderer>(); renderer.sharedMaterial = Resources.Load<...
0
votes
0answers
10 views

Adding calls to an Entities update function

So I am trying to add a property to my entity function then in order for it to update I need to call it within the entity's update function so this is how I create the entity var sprite = ...
0
votes
0answers
102 views

Unity 5 2d array for storing game objects and their data

I want to have a 2D array which has a number of rows relating to the number of game objects and 3 columns. I want each row to have the name of the game object and its position and velocity. Is this ...
0
votes
0answers
463 views

Unity3D - Unable to attach script to GameObject prefab at runtime

I've got a script that manages a scene browser within my application where I'm hoping to generate a new button instance for each scene found. I've put together a button that I've made into a prefab ...
0
votes
0answers
59 views

Particle system ONGui()

I have some scripts which uses OnGUI() method and they are attached to my GameMenu object. I need to play a particle system on the scene while the GUI scripts are active. When I do that I cant see the ...
0
votes
0answers
39 views

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 ...