How to GameObject.FindGameObjectsWithTag within children of a specific...
I want to get a collection (List or GameObject[]... whatever I can iterate through) of the children inside a specific GameObject with a Tag assigned to them. But I'm only able to run...
View ArticleChecking if Player object is out of bounds
Hello, I have written a javascript code for checking the player if they have fell out of bounds. This is a 3D platformer that I am tring to make. I am recieving errors and can not run the game with...
View Articleusing gameobject.find('key') but i want to make it with a tag
so i i am creating a game where you need to find keys and pick them up. although i will need to assign a tag or make many different scripts for each key carryingBlue = true;...
View ArticleAssigning a GameObject as Player with a button
So I'm setting up a basic character creation screen and there are two models on the screen. I want to set up that when you press the button under the model, it will give it the Player tag and add the...
View ArticleAnyone experiencing problem with gameObject.tag?
On my "OnTriggerEnter(Collider col)" I am checking col.gameObject.tag == "someTag"; It works well on Android/Editor mode, but not iOS/StandAloneWin. I logged the col.gameObject.tag on screen using...
View ArticleOnCollisionEnter doesn't work !
Hello ! I searched on Google but I didn't find my problem's solution. I'm creating a game, I've got a sphere, and that sphere (controlled by a joystick because it's a mobile game) has to move on a road...
View ArticleMy Tags are getting changed, when its loaded from Asset Bundle.
I have created an asset bundle from several scenes. After downloading and loading the scenes, the tags for the game objects are either becoming as Undefined or the tags for the game object are getting...
View ArticleGameObject is already being activated or deactivated
Hi all, I´m having a little problem with my current development process.. When my player dies, the gameObject is deactivated. So far so good. In my game I have moving platforms with a parenting code...
View ArticleDetect a gameObject's tag via OnCollisionEnter()
Hi, I am trying to detect the tag of a gameObject when it collides with another object. Here is my script so far: function OnCollisionEnter (collision:Collision) { if (collision.gameObject.tag ==...
View Article[C#] Raycasts and Object Tags
I have this code that cast three rays in font of an ai to check if there if something there. then if something is there. Physics.Raycast(transform.position, left, out lhit, StayD);...
View ArticleHow can I get a reference to a gameobject in my C# script?
I currently have the following: public List myWalls; And in the unity property inspactor script definition area I have: My Walls Element 0: Wall1 Element 1: Wall2 Element 2: Wall3 Now I would like to...
View ArticleHow to rotate game object on fixed position
Hi can anybody please tell me that how to make game object rotate on fixed position! Please tell me the full procedure with steps as i'm beginner to unity.
View ArticleIf/Else statements effecting only specific tags
Hi, I want to create various scenarios that effect only specific gameObjects with specific tags. These scenarios all come in the form of if/else statements. For these examples, let's just include the...
View ArticleBCE0019 transform not a member of Object error only in Android build
had some code working in a pc build. I switched to android build and got error. Using this code above function Update()(JS): var Block1; Block1 = GameObject.FindWithTag("Block1").transform; var...
View ArticleC# How to assign tag to GameObject at runtime?
I'm trying to create and assign a tag to a GameObject so I an access it later on, but discovering that I cannot at run time assign tags to GameObjects created. For example, if I have a loop that...
View ArticleGetting object tag via raycast
So i have an object tagged as "Mover", and i want other game objects to know if they are over a mover or not, i've tried a few things but i'm a bit lost. Basically the object recognizes it's over...
View ArticleArray elements change Gameobject.tag
Hi I have an array of materials which I can assign in the inspector. I was wondering is there a way to have each element of the built in array change the tag of the gameobject its attached to. This...
View ArticleNothing Happens at OnTriggerEnter ?
I've got a problem about OnTriggerEnter; #pragma strict static var health : int = 100; var bullet : GameObject; var explosion : GameObject; function Start () { bullet =...
View ArticleCompareTag - NullReferenceException
Collider2D Obj = Physics2D.OverlapCircle(transform.position, 0.05F); if(Obj.CompareTag("SomeTag")) { isActive = true; } NullReferenceException: Object reference not set to an instance of an object....
View ArticleNull reference error can u help me to fix it ....!
hello all i am bit new to scripting in unity. im having a small issue, i want to specific effect when i hit a specific gameobject with a tag. from my code i want to shift from 1st player to second when...
View Article