GML Unique Object Collision

I have a Collide event with the character that swaps the sprite of a flower to an animated sprite. Problem is when the character triggers that one flower then ALL the instances of that flower object change sprites. Can you point me in the right direction to fix it so just the one flower reacts?

CHARACTER
(collision event)
Code:
oEnvWeeds.image_speed = 1;
FLOWER
(create event)
Code:
image_speed = 0;
(step event)
Code:
if (image_index >= 10)
{
    image_speed = 0;   
    sprite_index = sEnvWeedsDed;
}
 

Guitarmike

Member
I think you are confusing the object and the instance of the object. A single object can have many instances. In a collision event, the keyword "other" returns the specific id of the instance that has been collided with. Change your collision event to something like this:

Code:
other.image_speed = 1;
PS - a question like this probably belongs in the "programming" forum, not this one.
 
I think you are confusing the object and the instance of the object. A single object can have many instances. In a collision event, the keyword "other" returns the specific id of the instance that has been collided with. Change your collision event to something like this:

Code:
other.image_speed = 1;
PS - a question like this probably belongs in the "programming" forum, not this one.
Mike you are a Gentleman and a Scholar! Thank you. And I wanst sure were to post. Apologies all. But That did in fact work. Thanks friend
 
Top