- Home /
"GameObject.FindWithTag" Working with one scene but not another
Hi guys,
I feel something strange is happening in one of my projects, I have this code bellow that works on one scene but not another, the one it doesn't work in is my main scene (and yes I have both tags). I'm not sure quite what to do, or if i'm doing something wrong, I have tried rolling multiplier in one room so that might be it, any suggestions please help.
using UnityEngine;
using System.Collections;
public class testytest : MonoBehaviour {
public GameObject map;
// Use this for initialization
void Start () {
map = GameObject.FindWithTag("Map");
}
// Update is called once per frame
void Update () {
}
}
Answer by MIkeross3 · Mar 06, 2015 at 02:11 AM
I may be mistaken but isn't it
map = GameObject.FindGameObjectWithTag("Map");
even so, I prefer to use layers. String methods as above are not suggested for performance
Nope :)
http://docs.unity3d.com/ScriptReference/GameObject.FindWithTag.html
It's FindGameObjectsWithTag ($$anonymous$$ultiple)
Your answer
![](https://koobas.hobune.stream/wayback/20220613185129im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Detect a gameObject's tag via OnCollisionEnter() 5 Answers
IOS Gun shooting script 1 Answer
Null reference error can u help me to fix it ....! 0 Answers
PC build crashing on launch everytime 1 Answer
Trying to make the enemy fire 1 Answer