instance_destroy() doesn't allow game to compile

C

Century

Guest
I am running the most recent version of gamemaker studio 2 and I am using the tutorial on Youtube (the one made by YoYo). I have entered the following code in to the events tab exactly as it is represented in the video, but I get an error, the video does not. Any ideas as to why this is occurring?

Code:

if (instance_exists(obj_player))
{
move_towards_point(obj_player.x,obj_player.y,spd);
}

image_angle = direction;

if (hp <= 0) instance_destory(self);

NOTE: This is one of the examples.
 
Top