M
MagicPolygon
Guest
So, long story short, I'm having difficulty getting an object's collision detection to work properly.
The screenshot below sorta explains what's going on. It only happens with diagonal objects like the car. I've already enabled precise collision detection (plus I'm also using another sprite as the collision mask, which likewise has precise collision), but for some reason, when it comes to detecting any kind of collision that isn't movement-related, it treats the object as if it's a big square that nothing can pass through. No line of sight, and no bullets. Yes, the player's bullets immediately stop if fired inside the pink box. However, the player and enemies are able to move inside. So, movement collision works. Everything else doesn't.
If it helps, the car object is a child of a parent object called Block, which I use as the main obstacle that nothing can pass through. For example, one of the lines in the enemy's code that searches for players goes like this:
In other words, it will detect a player if they are within their line of sight and there is no Block object inbetween.
So, I'm somewhat confused here. Any ideas?
The screenshot below sorta explains what's going on. It only happens with diagonal objects like the car. I've already enabled precise collision detection (plus I'm also using another sprite as the collision mask, which likewise has precise collision), but for some reason, when it comes to detecting any kind of collision that isn't movement-related, it treats the object as if it's a big square that nothing can pass through. No line of sight, and no bullets. Yes, the player's bullets immediately stop if fired inside the pink box. However, the player and enemies are able to move inside. So, movement collision works. Everything else doesn't.
If it helps, the car object is a child of a parent object called Block, which I use as the main obstacle that nothing can pass through. For example, one of the lines in the enemy's code that searches for players goes like this:
Code:
if !collision_line(x,y,Player.x,Player.y-11,Block,false,true)
So, I'm somewhat confused here. Any ideas?