Greetings,
I’m once again taking a stab at source dependent immunity frames, I won’t rest until I finally make it work!!
THIS TIME, I think I’m finally close to cracking it, but I’ve hit a roadblock. I’ve commented everything in the screenshots, but allow me to give the basics of how I want this to work:
When an enemy is hit by an attack that can pierce, it’s UID is added to a structure variable as a child, with it’s value set to the attack’s immunityTime variable (For immunity frames). Each child variable’s value decreases by 1 per frame, and once it hits 0, delete it from the structure
This way, if an enemy is hit by an attack, but you want the enemy to be hit by that particular instance of the attack again (Without interfering with other attacks or becoming immune to everything), then this allows such a thing to happen
This is useful for attacks that linger, lasers, big projectiles, etc
So far, I’ve gotten the piercing system set up and good to go, but I have an issue with the structure child code
When I check the debugger, this is what’s happening…
- The child’s value does not decrease until the next bullet is fired
- The child’s value stops decreasing once the bullet that hit it no longer exists (Destroyed offscreen)
- The child’s value is decreasing much slower than expected for some reason
What I WANT to have happen is…
- For each child, the moment they exist, decrease their value by 1 per frame
- Once that value is empty, the child deletes itself
The culprit is that the child is still keeping track of the bullet that hit it, but I don’t know how to access the child’s name in the condition when the name is the UID created during runtime, and for some reason “For each child” doesn’t exist for object structures…
So… is there a way I can access the name for each individual child structure when they’re created during runtime? I feel like I’m sooo close to the answer, but I can’t quite figure it out












