how to attach an object to multiple object x and y?

T

teamrocketboyz

Guest
hello all so far in my game i have a grenade object that i can throw and a light follows the grenade exactly due to me setting the step of the light as follows.

x = o_grenade.x
y = o_grenade.y

this is pretty basic stuff. but if i throw more than one grenade only the first one gets the light following it. how can i edit this so that the light follows every grenade thrown?
 
P

Pyxus

Guest
hello all so far in my game i have a grenade object that i can throw and a light follows the grenade exactly due to me setting the step of the light as follows.

x = o_grenade.x
y = o_grenade.y

this is pretty basic stuff. but if i throw more than one grenade only the first one gets the light following it. how can i edit this so that the light follows every grenade thrown?
I assume at some point you're using instance_create to make the grenade in which case store the instance value in a variable and set the light's x and y to that instance's x and y like so:
grenade = instance_create_depth(x, y, depth);
x = grenade.x;
y = grenade.y;
 
Top