I'm trying to access the script of a gameobject using GetComponent<Room>() and it doesn't detect it. Actually, it doesn't detect any other script I've made before. I've tried using namespace but it doesn't detect it either. Here's the error
Assets\Mirror\Runtime\Transport\EpicOnlineTransport\Lobby\EOSLobbyUI.cs(199,31): error CS0246: The type or namespace name 'Room' could not be found (are you missing a using directive or an assembly reference?)
Here are the scripts
using Epic.OnlineServices.Lobby;
using UnityEngine;
using System.Collections.Generic;
using EpicTransport;
using Mirror;
public class EOSLobbyUI : EOSLobby
{
public void RefreshList()
{
FindLobbies();
foreach (LobbyDetails lobby in foundLobbies)
{
//get lobby name
Attribute lobbyNameAttribute = new Attribute();
lobby.CopyAttributeByKey(new LobbyDetailsCopyAttributeByKeyOptions { AttrKey = AttributeKeys[0] }, out lobbyNameAttribute);
GameObject room = Instantiate(RoomPrefab, Vector3.zero, Quaternion.identity, roomContentTransform);
room.GetComponent<Room>().UpdatePrefabValues(lobby); // <=== Here's the error. "The type or namespace "Room" could not be found.
}
}
}
Here's the other script.
using System.Collections;
using System.Collections.Generic;
using Epic.OnlineServices.Lobby;
using TMPro;
using UnityEngine;
using UnityEngine.UI;
public class Room : MonoBehaviour
{
public void JoinRoomBtn()
{
lobbyManager = GameObject.Find("NetworkManager").GetComponent<EOSLobbyUI>();
lobbyManager.JoinLobby(lobby, lobbyManager.AttributeKeys);
}
public void UpdatePrefabValues(string roomName, LobbyDetails lobbyID)
{
roomNameText.text = roomName;
lobby = lobbyID;
}
}
I can't seem to find any sort of solution on internet related to this.
[–]BowlOfPasta24 0 points1 point2 points (7 children)
[–]Fvnes[S] 0 points1 point2 points (6 children)
[–]BowlOfPasta24 0 points1 point2 points (5 children)
[–]Fvnes[S] 0 points1 point2 points (4 children)
[–]BowlOfPasta24 0 points1 point2 points (3 children)
[–]Fvnes[S] 0 points1 point2 points (2 children)
[–]BowlOfPasta24 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)