Makkeonmies
Member
So in my game, I can't use Collision Event for obj_enemy because obj_enemy needs to be marked as Solid, and that will stop it upon any collision.
So I put the following in Step event to work around it:
The idea is, when obj_enemy has var escape=false, it cannot pass through obj_limit, but when escape is true then it can. When it can't, I want it to change direction to where it came from, and thus stay inside the obj_limit boundaries (the object is basically a big empty rectangle)
It does detect the collision when I, for example, make it show_message() upon collision between obj_enemy and obj_limit, but if I put any collision code there, (speed = 0, etc.) it doesn't work and obj_enemy just passes right through.
So how to make obj_enemy stop upon collision with obj_limit, or turn around.
Any help much appreciated.
So I put the following in Step event to work around it:
GML:
if place_meeting(x,y,obj_limit){
if escape=false{
direction = image_angle+180
}
}
It does detect the collision when I, for example, make it show_message() upon collision between obj_enemy and obj_limit, but if I put any collision code there, (speed = 0, etc.) it doesn't work and obj_enemy just passes right through.
So how to make obj_enemy stop upon collision with obj_limit, or turn around.
Any help much appreciated.
Last edited: