Get id from collision_line possible?

How do you find the id of an object on a collision_line since it goes with an if statement, and probably doesn't set variables?
 

FrostyCat

Redemption Seeker
Return value = The value of the function when used as part of an expression. The right side of a variable assignment expects an expression. Use it there.
Code:
colliding_instance = collision_line(x, y, x+100, y+100, obj_enemy, false, true);
Now you can use colliding_instance any way you want.

Also, stop believing in this parochial "belongs in if statements" crap, because nothing in GML goes only with if statements. Comparison operators like == and != can belong outside if statements. Boolean functions like keyboard_check_pressed() can belong outside if statements.
Code:
a = 5;
b = 7;
key = vk_up;
a_equals_b = a == b;
up_pressed = keyboard_check_pressed(key);
 
Last edited:

FrostyCat

Redemption Seeker
For now it's 100000, but don't count on it staying that way in the future or across exports.

If you want to check for sure whether a real instance has been found, check that it is not set to noone.
 
For now it's 100000, but don't count on it staying that way in the future or across exports.

If you want to check for sure whether a real instance has been found, check that it is not set to noone.
noone it is!

How do I make this topic solved in the new forum?
 
noone it is?

How do I mark this solved in this new forum?

Whoops posted this twice, can't find any delete in this forum either.

edit:
Found solved now.
 
Last edited:
Top