jujubs
Member
I'm trying to do a hitscan weapon, and read elsewhere that collision_line was a good way to go about. So, I draw a line across the screen using this:
Once my player's state machine gets to "Shoot", it draws the line perfectly, going through the enemy that sits on the right.
However, when I try this with collision_line, like so:
...I ALWAYS get a hit on the enemy, even if I move my player up or down before shooting. Why?
Code:
if(test> 0)
{
draw_line(obj_player1.x+16,obj_player1.y-1,obj_player1.x+1000,obj_player1.y+1);
}
However, when I try this with collision_line, like so:
Code:
with (obj_spawner)
{
collision_line(obj_player1.x+16,obj_player1.y-1,obj_player1.x+1000,obj_player1.y+1, id, true, false);
instance_destroy();
}