S
squidsRockets
Guest
I am trying to implement a vision mechanic in my game (not using distance_to_object) by using an object with the sprite of a vision cone.
This is the current code for creating the cones at the start of the game.
My intent was for the game check if a vision cone had been created and if not, create one. This works fine, each enemy creates a cone but it drops it right away and the cone doesn't follow them.
So I added this code
I also tried this in the oVision code itself but either way, all of them follow one enemy object.
How do i get this so each enemy gets a vision cone to stick to them.
I would also appreciate any advice for a different vision/detection system.
This is the current code for creating the cones at the start of the game.
Code:
//Check if we have vision
HaveVision = instance_place(x,y,oVision)
if instance_exists(HaveVision)
{
CanSee = true;
}
if CanSee == false
{
instance_create(x,y,oVision);
}
So I added this code
Code:
with(oVision)
{
oVision.x = x;
oVision.y = y;
}
How do i get this so each enemy gets a vision cone to stick to them.
I would also appreciate any advice for a different vision/detection system.