collision line

  1. A

    Legacy GM Trying to make it so the only walls that are visible on screen are in my player's line of sight

    however, I seem to run into a problem where all the walls are just permanently invisible when i start a room this is the code I used: if collision_line(x,y,obj_player.x,obj_player.y,obj_wall,1,0) {visible=false;} else {visible=true;} Also, here's more or less an...
  2. FoufaDjo

    GMS 2 Help With Bullet Collision line

    so am trying to make a fast bullet collision for my game but i have problem with targiting the enemy object sometimes i i think its becaue that the event_preform start sometimes when the enemy object is destroyed so the collision event cant find the enemy id if you guys have any idea to how to...
  3. P

    GML Collision line [Solved]

    Hello, So i am working on a game at which the unit shoots at the point an enemy is in its shooting range. I have an animation for when he is supposed to shoot and with reload in one. But when i test it the unit will do the animation for the amount of the first alarm but then restarts the...
  4. Z

    GML Collision_line not working.

    Hi, I'm making a top-down stealth game, and I don't know how to make it so specific enemies can't see through walls. For the guards, I made it so the fire out pellets towards the player, and they are destroyed when hitting a wall. When the player touches one, it changes a global variable called...
  5. S

    collision line detection

    So im making a zombie stealth game, so the zombies have to follow the player when they see the player, i did this with a collision line that is drawn towards the point they are facing. The only problem with this method is that the collision line is very thin. So basically i have to stand exactly...
  6. Pfap

    collision line list problem

    I am running about 6 collision line lists from left to right and they are all mostly stable, but I'm having trouble with just one. I checked the docs and they didn't explicitly state which order colliding instances would be added to the list so, if this is normal behavior please let me know...
  7. S

    (fixed)zombie with colliosion line doesnt work

    //step step var view_distance = 800; var tx = x+lengthdir_x(view_distance,direction); var ty = y+lengthdir_y(view_distance,direction); if (collision_line(x,y,tx,ty,obj_player,true,false)) { if (collision_line(x,y,obj_player.x,obj_player.y,obj_wall,true,false)) = noone { state...
  8. S

    collision line set in sprite angle

    is there anyway you could use a collision line going in the same direction your enemy is facing? lets say you use a collision line as a detector for your enemy to check if he sees you or not. i dont have extremely much experience with gml yet but i tried this: //step event image_angle =...
  9. Blaize

    GMS 2 [SOLVED] Collision Line Troubles

    Ok, so right now, I'm using collision_line() in a Megaman.exe-style game as part of a sensor-like function. So, let's have a look at this image: Ok, so the one with the green square is the player and everything else is an enemy. The white rectangle is our player's collision line. It's origin is...
  10. Strobosaur

    GML Another fast bullet collission thread [SOLVED]

    Sorry if the answer has already been posted, i've looked around but haven't found any good solutions. It's a classic case of a projectile traveling too fast to collide with the intended target. I do have a script in place to check for a line collision every step, and it works EXCEPT in the...
  11. X

    Legacy GM [SOLVED] Line of sight bug

    I have this really weird bug where my collision lines only sometimes detect properly. If the player is visible to the enemy, the shooting animation should be playing. I made a short video showing the bug: https://www.dropbox.com/s/xhu3bpxpm51k5un/helpPls.avi?dl=0 I can't figure out why jumping...
  12. M

    Legacy GM Checking for all solid instances

    Is there an easy way to check for all instances that are solid? I'm trying to use 'collision_line() ' to make an enemy shoot only when there are no solid objects in the way. I know i could use parenting but that would complicate MANY other things in my game. Any replies would be greatly...
  13. C

    Instance Nearest in a Direction

    Hey GM community, Ever played Kung Fury: Street Rage? My aim is to code a similar enemy targeting mechanic for a mobile app. The player swipes left or right to attack. If the player swipes right, I want the player object to interact with (kill) nearest enemy instance to player in that direction...
Top