0101: Variable is not a class instance

Compiler found a possible class method used with a variable, but the variable type is unknown:

if
  $player.isPlaying
then
...
end

In order to correctly identify the command used here, the compiler should know what class the $player variable represents.

Possible solutions:

  • Define the type of the variable explicitly using a var keyword:

var $player: Player
if
  $player.isPlaying // compiles as 0256: is_player_playing $player
then
...
end
  • Define the type of the variable explicitly using the Player class name:

Player $player
if
  $player.isPlaying // compiles as 0256: is_player_playing $player
then
...
end
  • Use a combination of the class name and class method:

if
  Player.IsPlaying($player) // compiles as 0256: is_player_playing $player
then
...
end

Last updated