Problem with the collision condition

I am making a game that involves asteroids falling from above that the player most avoid. I have them evenly spaced along the x axis using values from a table that are randomly selected. My problem is with the y axis. I created an invisible hit box instance that trails behind the asteroids using a game attribute I created called "Ytracker." I just add enough space to the Ytracker in order to make sure it does not touch the asteroid it is following. This hit box is used to create space between the first asteroid and any that could randomly spawn behind it (giving the player a space to escape through). My plan was for any asteroid that followed behind to close to be destroyed and then re-spawn at another random point along the X axis. My problem is that when I start the game all instances of the asteroid are all destroyed, they are never even visible (they spawn just out of view from above the screen) and only the hit box is visible (along with another hit box that is used for collisions between the asteroid and player). I am sure that the hit box is not touching the asteroid itself. I have tried increasing the space between them but it does not help. Could this be a problem with the Ytracker attribute? Could the hit box be snapping to the asteroids position before it adds the extra space between them? This is my first GameSalad project and any help would be greatly appreciated! :smile:

Here are two images of my project. The first one shows what it looks like with the collision rule turned on (if there is a collision between the asteroid and top (pink) hit box to destroy the asteroid instance). The second shows what happens when I turn the rule on, the asteroids are destroyed before they come into view from the top and only the pink and red hit boxes are visible.


Sign In or Register to comment.