E
E.M.I
Guest
Hey GameMaker community! So I'm trying to make a basic script that assures that shadows will always appear in front of the player but always appear behind the object they're the shadow of. For this I'm making code that, when the shadow collides with the player, changes the depth value of the shadow and the object the shadow comes from to be higher than the player's.
However, I don't want to make every single object's depth value higher, so I thought to create an array where all the objects are stored that I can call on. However, for that to work, I need to be able to change the depth value of all objects inside the array. Is this possible? (something like shadow_depth[all] maybe). Thanks a lot! To help a bit, here's what the code would look like.
(Inside the collide event with the player object, obj_eitim)
However, I don't want to make every single object's depth value higher, so I thought to create an array where all the objects are stored that I can call on. However, for that to work, I need to be able to change the depth value of all objects inside the array. Is this possible? (something like shadow_depth[all] maybe). Thanks a lot! To help a bit, here's what the code would look like.
(Inside the collide event with the player object, obj_eitim)
Code:
depth = (obj_eitim.depth - 1);
shadow_depth[all] = (obj_eitim.depth -1);