Help-me Easy, error CS0131: The ....

public static Transform Spawn(Transform prefab, Vector3 pos, Quaternion rot)
{

return (Transform)Object = PhotonNetwork.Instantiate(prefab.name,pos,rot,0);
}

result :

error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer

public static Transform Spawn(Transform prefab, Vector3 pos, Quaternion rot)
{
Transform t = PhotonNetwork.Instantiate(prefab.name,pos,rot,0);
return t;
}

I need to leave it as it is if I change this error happens

(46,32): error CS0029: Cannot implicitly convert type UnityEngine.GameObject' toUnityEngine.Transform'

return Object, help-me

public static Transform Spawn(Transform prefab, Vector3 pos, Quaternion rot)
{
Transform t = PhotonNetwork.Instantiate(prefab.name,pos,rot,0).transform;
return t;
}
1 Like

thanks methos5k <3

no problem :)