Hi again,
So I’m working on a very simple script, I have these 2 following classes which I will call for player death
public class Player : MonoBehaviour
{
[SerializeField] private float deathHeight = -20f;
// Update is called once per frame
void Update()
{
}
private void PlayerFall()
{
if(transform.position.y < deathHeight)
{
GameMaster.KillPlayer(this);
}
}
}
And
public class GameMaster : MonoBehaviour
{
public static void KillPlayer (Player player)
{
Destroy (player.gameObject);
}
}
I get this code indicated on the “this” argument in the PlayerFall() function
“Argument 1: cannot convert from ‘Player [Assembly-CSharp-Editor, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]’ to ‘Player [Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]’ [Assembly-CSharp-Editor]”
What does this mean?