Hy,
I want to assign a RectTransform component and also a Transform component into my script however when
I play my game, it does not recognize the object I want to assign.
How can we explain that?
here is my script:
public RectTransform MenuContainer;
public Transform LevelPanel;
public Transform LevelPanel;
private void Awake()
{
//pour remettre la scene à jour à chaque réouverture du menu:
menuContainer = (RectTransform)gameObject.transform.Find("MenuContainer");
if (menuContainer == null)
{
Debug.Log("MenuConainer is null");
}
LevelPanel.transform.Find("LevelPanel");
if(LevelPanel == null)
{
Debug.Log("LevelPanel is null");
}
StoryPanel.transform.Find("StoryPanel");
if(StoryPanel == null)
{
Debug.Log("storypanel is null");
}
}
Thank You!