HitBoxes multiple versions of same actor

RCT_GamesRCT_Games Member, PRO Posts: 97

Hey need some help with hitboxes,

Right now I have my actor spawn and when that happens it spawns a hitbox that is constrained to the actors x and y. It follows fine and when the hitbox gets hit a global attribute gets activated that tells the actor to destroy. This works fine when there is only one of them on the screen.

The problem that I have is there are multiple versions of the same actor that spawn on the screen, but when you shoot one of the actors a random one is killed. My best guess is that it is what ever one can run the sequence first.

So rather then creating a bunch of code so each of the actors that spawn use a different kill number. Is there a way to have the hitbox only kill the actor that is touching it?

Thanks for the help

Comments

  • RCT_GamesRCT_Games Member, PRO Posts: 97

    Figured out the problem,

    Created a table with 500 rows because it should never pass that

    Then I made it so when a guy spawns it grabs a global number along with the hitbox. Once it gets the number it then changes the value up 1

    then when the hit box gets killed it changes the table value to 1, which the actor sees and then dies because of that.

    Thanks for the help though.

Sign In or Register to comment.