I'm currently trying to make the fire object (created by the fireball) stick to the enemy, by specifying the enemy type and its id. I'm getting the following error:
"Unable to find any instance for object index '-4' name undefined". Here's my fireball [collision with enemy] code:
var sp=other.speed
var dir=other.direction
var oi=other.id
var on=object_get_name(other)
with (instance_create(other.x-lengthdir_x(new_push_amount, pd),other.y-lengthdir_y(new_push_amount, pd),fire))
{
speed = sp
direction = dir
enemyid = oi
enemyname=on
}
And here is the Create,
enemyname = ""
enemyid = 0
and the Step events of fireball:
speed = instance_find(enemyname,enemyid).speed
direction = instance_find(enemyname,enemyid).direction
Maybe I'm using the wrong functional to get the instance... In any case, help would be really appreciated!