Questions tagged [gameobject]
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.
279 questions
1
vote
1
answer
59
views
Animation can't disable gameobject
I'm using a very basic animation to create a transition, which involves deactivating a gameobject on the last keyframe.
Goal:
The ChangeRound animation is about 1 second long. It enables the UI image ...
1
vote
1
answer
95
views
Is there a way in Unity to detect which gameobjects are making it take longer to enter/exit play mode?
I have a scene with quite a few gameobjects in it and for the first time since using Unity, when I enter/exit play mode (or even close and reopen the scene) it takes about a minute to complete this. ...
1
vote
2
answers
166
views
How to make health bar or speech follow but not rotate with character container?
I have a top-down character object that is a Container of various parts.
This character can have elements that should move along with it (think a health bar, a speech bubble) that should NOT rotate ...
1
vote
1
answer
131
views
Is there a way to filter/search only the children of a selected gameobject in the hierarchy panel?
I'm not sure if there's a setting or wildcard I'm missing, but when I search in the hierarchy panel the results are presented in alphanumerical order with no reference to the hierarchy of the ...
1
vote
1
answer
104
views
In Unity if you use Destroy on a GameObject and then immediately change the GameObject value, which GameObject gets destroyed?
Since Destroy happens after the update cycle, I wonder if you could accidentally (or intentionally) change what gets destroyed since you can still have code execute after calling Destroy.
For instance,...
3
votes
2
answers
855
views
How do I check if a GameObject is touching another GameObject in Unity?
I am trying to check if a GameObject is clicking another GameObject.
I am trying to make a 2D shooter like Duck Hunt so this is important.
I have tried ...
0
votes
1
answer
64
views
I need multiple custom game objects to stick to a parent object
A bit of a newb to Unity & game development. I have built a very basic lunar lander ship and made some RCS thrusters out of cubes and cylinders to attach to the fuselage of the ship. However, ...
0
votes
2
answers
284
views
Destroy doesn't destroy GameObject
I was trying to create a debug view for my Water object in my Unity application. The problem is that I generate the water at runtime, which makes it impossible to see what it looks like in the editor ...
4
votes
1
answer
654
views
What are good ways to make modular corridors and interiors of buildings?
I would like to make modular corridors and some other objects in my level, to make it easier to construct them.
Do I separate walls, floor, and ceiling or make a tube module?
How to avoid seams ...
0
votes
2
answers
951
views
How to set GameObject on tilemap through script
In the built in Tile Palette tilemap editor, you can choose a GameObject brush to set custom tile GameObjects. How would I be able to set a gameObject onto a tile through a script?. There is no ...
0
votes
1
answer
149
views
Why is the position of my GameObject inaccurate when copying another object's position?
I've been stuck with this nightmare for a while, and it's certainly my perfectionism. What I have is a cannon that fires a shell from an object pool. The order of operations is as follows.
The ...
1
vote
1
answer
645
views
Destroy and instantiate player prefab
I am new to game development.
I am trying to change the player prefab every X seconds.
For that, I am destroying the previously spawned prefab and instantiating a new prefab.
But I don't know how to ...
1
vote
0
answers
60
views
WebGL 2.0: Attaching a shader object to a game object
I'm making a 2d game engine using Java Script and WebGL, both of which I am new to, and was wondering if it was a good idea to use a shader object to initialize the fragment and vertex shader and then ...
0
votes
1
answer
224
views
Is there a way to completely delete a specific Object Variable from an existing GameObject?
When my GameObjects have run their course, I would like to scrub them and prepare them to go back into an Object Pool.
Each of my main GameObjects has around ~20-30 Object Variables. Part of the ...
1
vote
0
answers
326
views
How can I implement a cursor object that is controlled by either a keyboard or a gaming controller?
I'm looking to implement a cursor object similar to the ones from certain tactics RPGs (think Fire Emblem, FFT, etc.), but I'd like for it to be controlled by either keyboard keys or controller ...