No overload for method ” takes 1 argument

Here,

if(Player2.GetActive(true))

you are passing an extra argument (true) to the method GetActive. As we can see from the method declaration of GetActive, it takes no parameters:

public bool GetActive() { return Active; }
//                   ↑
//              empty parentheses

I think what you mean here is “if Player2.GetActive() is true…” right? You don’t need to specify the value you want if it is true, just doing this is fine:

if (Player2.GetActive())

If you want to check if it is false, add ! before the call to negate the result:

if (!Player2.GetActive())

Leave a Comment