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

Setting the pivot point at the center of the base of a GameObject

I am creating a game in Unity 3D. In the game scene I am dynamically creating GameObjects, one of which is a building. I would like to change the pivot of the building to be at the center of the base of the building, this way when I instantiate this…
sabo
  • 911
  • 13
  • 37
0
votes
2 answers

Unity c# rooms finding close rooms

I have a Unity game I'm working on. Currently it’s at a basic state, but the goal is to somewhat replicate the gameplay of old style telnet MUDs in a graphical fashion. Map construction at this phase is manual, not automatic, although that’s planned…
Marky
  • 175
  • 1
  • 10
0
votes
1 answer

GameObject gets dropped when game is in play mode "NullReferenceException object reference not set an instance or object"

I have an empty object called TimeManager. On the object I have attached the following script. I then dragged the text UI GameObject "MyTime" to the Text Timer field. When the game is not playing everything shows up. When I hit play the object…
Tim Cooley
  • 749
  • 4
  • 19
  • 38
0
votes
0 answers

Unity 3d how to display a group layout like a horizontal arc

I am developing a game for cards. I have a deck of cards. want to display the cards like an arc shape. I have implements it but its showing all the cards in deck horizontally by using horizontal layout group script provided by unity. I am trying to…
farhan678
  • 85
  • 13
0
votes
2 answers

Unity3D : make cylinder stretch from one point to another

I'd like, at each frame, to move, scale and rotate a given cylinder so that it behaves like a 'rope' between two points. I have this code at the moment, but it doesn't work at all like intended : hook.transform.position = (rightHandPosition +…
Mat
  • 952
  • 2
  • 11
  • 28
0
votes
3 answers

Unity 3D : UI Image in the direction of a game object

I'll explain my issue (My English is a little lame sorry). I have a Player ( Camera) who is able to move in a Unity Scene. In this scene there is some GameObjects. Those GameObjects May be too far for the camera to see. What I want to achieve is to…
tinkz
  • 100
  • 2
  • 17
0
votes
2 answers

Destroy the clones by walking into them

I found a good re-spawner for my game and I respawn 50 spheres. I want them to disappear when I walk into them but they do nothing. Here is my script: using UnityEngine; using System.Collections; public class BoxDestroy : MonoBehaviour { …
Wes
  • 33
  • 1
  • 1
  • 7
0
votes
1 answer

Unity3D Instantiating as GameObject

My code look like that: if (Input.GetButtonDown ("Fire2")) { GameObject transparent = Instantiate (building, new Vector3 (0, -10,0), Quaternion.identity) as GameObject; } Where building is public GameObject which I add through unity …
Konrad
  • 21,590
  • 4
  • 28
  • 64
0
votes
2 answers

How to center parent game object in the screen?

I am trying to make a Scrabble word game using a fixed camera, but I have a simple issue. I add some boxes as game objects and the number of these boxes is the length of the word so if the word is "Fish" we will add 4 boxes dynamically. I did that…
eng.ahmed
  • 905
  • 4
  • 16
  • 38
0
votes
1 answer

Activating/Deactivating GameObject Not Working

I can't seem to get my button to activate gameobject. At the moment, I have the gameobject deactivating in the scene, but my button doesn't activate the gameobject. What am I'm missing in my coding? The script is currently not attach to the…
Coder
  • 499
  • 3
  • 13
  • 29
0
votes
1 answer

Delete admob by deleting gameobject. not working

i am new to unity. I made an application and decide to add advertisement to it. user can delete the advertisement when they clicked a button. so i put the googlemobileadsdemoscript to a gameobject and the button would destroy the gameobject when…
chen
  • 1
  • 1
0
votes
1 answer

How to set source image for a button in unity

I have a button UI game object. That doesn't have an image from the start. I fetch a image from the server and then set it as button image. Here is the code: WWW w = new WWW (newUrl); yield return w; Adbutton.GetComponent().sprite = …
Sameer Hussain
  • 2,421
  • 8
  • 23
  • 41
0
votes
2 answers

Return Gameobject to original position

I am using Unity for my project. What I am trying to do is when a button is pressed it moves a game object to a new position. Then when the same button is press again, the object returns to its original position. My problem is with the while loop I…
0
votes
1 answer

Getting a GameObject from Plane

I'd like to know if there's an easy way to represent a Plane as a GameObject. I'm using the FindPlane method from Tango's PointCloud that returns a Plane and I'd like to create a GameObject from that Plane so I can see it in my 3d world. Thx :)
Varu
  • 311
  • 1
  • 15
0
votes
2 answers

An automatic way to create gameobjects in Unity?

Basically is there an actually time saving way to creat a function that lets you create a GameObject specified by the function's parameter(s)? like: public void thing_maker(string gameobject_name, string sprite_name, string rg_body_name)
novasniff
  • 13
  • 2