I would highly recommend learning and using GML code for this
You can accomplish the exact same thing you're doing there with something like this:
if (uHealth < 1)
{
instance_destroy();
}
else
{
var collidingWith;
collidingWith = instance_place(x, y, object);
if (collidingWith)
{
direction = 180;
speed = 2;
if (uAttackDelay < 1)
{
collidingWith.humHeath = uAttackPower;
uAttackDelay = uAttackDelayMax;
}
else
{
uAttackDelay = -1;
}
}
else
{
direction = 0;
speed = 2;
}
}
I replaced
"Start moving in a direction" with two lines that just set the direction and speed, and will do the exact same thing (the direction variable is 0 for right, and counts up counter-clockwise in degrees).
This particular code is not working because, like you say,
other is unnasigned. In the code I've shown you above, I use a function called
instance_place to check (x, y) for (object), and assign the resulting object ID value to a variable called
collideWith. Now, in all the following lines, I am able to use
collideWith to refer to that
particular instance that I collided with, not none or all of them.
GML in particular isn't much harder to use than drag and drop, and is much more maintainable. You can see how
{ and
} are equivalent to the start and end-block events, and you can use
if and
else statements, etc. to set the conditions for those code blocks.
I don't know the drag and drop functions that well, so I can't help you more than that. Good luck with your game