i don't know why tag option is dosen't work
in my project. i use some tags. but my new tag is maybe doesn't work. has some picture ![alt text][1] red square : '1' it sprite tag is 'Key' so, as far as i know if i checked...
View ArticleRaycast isn't working when with tag
If I add "&& Hit.collider.tag" part to my function it wouldn't work, I check if the object desired is properly tagged and it was. void Raycast() { RaycastHit2D Hit = Physics2D.Raycast...
View ArticleHow to make unity recognice tags?
I have tried once and again to make unity understand that the enemy is NOT colliding with the correct object, but, after many changes, the debug.log ("va") is still triggering even when the enemy is...
View Articlecan someone tell me whats wrong with this code?
using System.Collections; using System.Collections.Generic; using UnityEngine; public class TagAssignCube : MonoBehaviour { public GameObject cube; // Use this for initialization void Start () { cube =...
View ArticleCan't you add tags using a script instead of tagging it through the editor ?
I was working on my project and thought that it would have been great if I could. Is there any way to add a Tag to a game Object through a script?
View ArticleMultiple tags for one GameObject
Hi everyone! Basically I am trying to create an inventory system for my game. Several tags attached to one object would really help! However it seems that that's currently not possible in Unity. If so...
View ArticleSpawnable AI Controller Script to chase FPS Controller that is tagged...
Hello, I am trying to modify an AIController Script that makes an NPC "Enemy" chase after the FPSController GameObject that is tagged "Player". Ultimately, I would like to spawn the "Enemies" equipped...
View ArticleSet a Tag Multiple GameObject[]
How can i set a tag multiple GameObject[] i tried this but its not work. public GameObject[] randomSpawnes; void SetTag(string tag ){ GameObject[] randomSpawnes = GameObject.FindGameObjectsWithTag...
View ArticleMaking object switch between two tags every 3 seconds
how Can I make a script that makes an object switch between 2 tags every 3 seconds?
View ArticleGame wont restart in the build, but works great in the editor..
UnityException: GameObject has undefined tag! at (wrapper managed-to-native) UnityEngine.GameObject:get_tag () at UnityEngine.Component.get_tag () [0x00000] in :0 at PlayerCollision.OnCollisionEnter...
View ArticleTrouble Swapping GameObjects on a Game Pad That are Prefabs.
Hi everyone, I am having a little trouble in making my gameobjects change from any position on my game pad. ---------- I have a script that works great for gameobjects, however, it does not work in my...
View ArticleHow do you find the tag of the object that is a trigger?
So, I'm new to unity, so I don't know if this is possible, but: How do you check the tag of the object that is in a trigger? Any way to do this would work. For example, I have a two player game with a...
View ArticleHow can i destroy spawned objects according a indicator?
Hi Guys. I have 7 Spawned objects and i have a random changed indicator with every played game. This indicator are have 7 Color/Tag. And 7 spawned objs. are have 7 tag one by one. I want, if this...
View ArticleUsing if with tag not always working
Hello, I'm making some sample projects and hobby games to learn this and that, and while making object placement using raycasting I've bumped into some issues I just can't figure out. using...
View ArticleHow to use a tag in children of an gameobject?
Hello all, I have a change-able character (a game object as a parent and there are 2 characters as child in it) (as an example you can assume a human can turn to a werewolf) Now I can access to the...
View Articlehow to store GameObject.FindWithTag("Name") and use as a tag?
Hello friends, Sorry for newbie question as I am newbie. I am gonna do this: void OnTriggerStay2D(Collider2D other) { if (GameObject.FindWithTag("Human") ) { //do something } } but the problem is...
View ArticleFindGameObjectsWithTag returns results only within hierarchy of calling...
I have the following simple validation to check if an UI pane is present in the scene: public static bool IsMenuDialogActive() { return GameObject.FindGameObjectsWithTag("MenuDialog").Length > 0; }...
View ArticleCollider Tag not working for enemy
I'm having a problem with letting the bullet notice it is an Enemy. This only happens when I try to use an explosionRadius. The enemy Prefab is correctly tagged as "Enemy", but it still won't recognize...
View ArticleHow do I get player to react differently on different pooled objects (clones)...
Im making 2D endless runner and im using object pooling. I want to make player react differently to different objects (clones). For example cloned obstacle will damage the player while some other one...
View ArticleMatch 3 game getting the colour of the match
so i'm making a match 3 game for a uni project, and I want there to be different things happening in the game depending on what the colour of the match is, the closest I've managed to get is a tutorial...
View ArticleCan not detect Tag
I have also tried making a samll overlap area around the 2D collider but that didn't work out here is the script` using UnityEngine; using System.Collections; public class hELT : MonoBehaviour { public...
View ArticleHelp with pick up script
Hi, I'm working on a pick up script but I can't figure out how to solve it unfortunately. Right now I have a working script where you look at a certain object and a text appears on screen depending on...
View ArticleInstantiated prefabs have no gravity AND weired script-behaviour
TLDR: 1. problem: If I **instantiate prefabs** **into a variable** (array), the **resulting objects have no gravity** and won't be affected by force (when throwing them they just stop the moment I...
View Articlehow to assign a tag to an object from Tilemap 2d?
how to assign a tag to an object from Tilemap 2d? Please for screens!
View ArticleCan you modify tags in unity using scripts alone?
Tags are useful, but sometimes you just need to modify tags on gameobjects duplicated with the instantiate command. Can anyone show me the way?
View ArticleWhy is this happening when I run my script?
My script here is supposed to make an object bounce when it touches a touchpad, but I did not want to use rigidbody, so I used this instead. But when running the script, instead of bouncing it...
View ArticleAre Tags the best solution for this? Duplicating an item that duplicates...
I have some code that causes a gameObject to out so far and duplicate itself multiple times before it destroys itself. I need to limit the amount of times that this happens. It might happen once or it...
View ArticleChange music when enemy is in scene
I have this proble, i want that when the game object tagged "Boss" spawns, the music changes, but when the boss is killed the music go back to normal. i´ve tried lot of things, i need help. I use a...
View Article2D Platformer: Failure to jump through platform
Hi! I'm working on a 2D platformer right now in Unity 2021.1.17f1, and I would like the player to be able to jump through specific (tagged) platforms when they press the down key. Unfortunately,...
View ArticleChild object collider being treated as if it has the same tag as parent object
I have an enemy set up as a parent object with a rigid body and a box collider, when it collides with the player the player is killed, this all works fine. I wanted to add a second box collider to the...
View Article