Having trouble with collisions, see post.

blenderartistblenderartist Member Posts: 32
edited November -1 in Working with GS (Mac)
I have an enemy, when it gets hit with one bullet it loses one haelth
the problem is, when it gets hit with two or more bullets at around the same time, it registers only one collision. Or it loses one health. How can I fix this?

Thanks in advance!

Comments

  • SkyMapleSkyMaple Member Posts: 817
    How are the attributes set up? Is there a timer?

    _______________________________________

    Game making service- http://gamesalad.com/forums/topic.php?id=21739
    Or email- Skymaplegames@gmail.com
  • blenderartistblenderartist Member Posts: 32
    No there is not a timer, should there be?
    I have an enemy rule; when actor with tag overlaps or collides add -1 to health.
    If i have one object that hits it, than another object hits it before the first one is destroyed, the enemy only loses 1 health.
  • calvin9403calvin9403 Member Posts: 3,186
    do you use a self attribute or a game attribute
  • blenderartistblenderartist Member Posts: 32
    A self attribute; I plan to have multiple copies.
    A game attribute is a global attribute, right?
  • calvin9403calvin9403 Member Posts: 3,186
    blenderartist said:
    A self attribute; I plan to have multiple copies.
    A game attribute is a global attribute, right?

    yep
  • blenderartistblenderartist Member Posts: 32
    So do you have an idea of what I should do?
    Or what I am doing wrong?
    Thanks!
  • calvin9403calvin9403 Member Posts: 3,186
    blenderartist said:
    So do you have an idea of what I should do?
    Or what I am doing wrong?
    Thanks!

    nope
  • blenderartistblenderartist Member Posts: 32
    Could someone help?
  • ChaserChaser Member Posts: 1,453
    Put the collision in the bullet
  • blenderartistblenderartist Member Posts: 32
    That would work...
    Except I have a lot of the same kind of enemy and if the bullet is colliding with the enemy, how do I tell the bullet to subtract health from that particular enemy?
    I cant use global attributes as I would need 1 for each enemy and I plan on using too many for that.
    Thanks for the idea, I could thing of a few other places where it could be used.
  • ChaserChaser Member Posts: 1,453
    It's the only thing that worked for me. In bullet multiple rules.
    When overlap or collides with enemy 1 reduce health of global attribute E1
    Next rule
    """"". ". ". Enemy 2 " " E2
    And so on
    It's tedious if you have lots of enemies but accurate
  • blenderartistblenderartist Member Posts: 32
    Ok, thanks!
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    blenderartist said:
    That would work...
    Except I have a lot of the same kind of enemy and if the bullet is colliding with the enemy, how do I tell the bullet to subtract health from that particular enemy?

    Have the subtract health rule in the actor, not the bullet. If you only have 1 enemy actor, and you are using multiple instances of that one actor on the stage, it's going to count on all of them if they aren't named differently. You will be shooting at one, and one of the others will die. You have to have an individual actor for each enemy if you have multiples of the same on the stage.
  • blenderartistblenderartist Member Posts: 32
    Yea, I think i figured out a way, I need to have a timer that every tenth of a second it will check to see if there is a collision and subtract 1 health if there is.
    I did not test this yet, so I am not sure if it would work, also that many timers may slow everything down too much.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    You really don't need a timer, you just need a simple rule in the actor that subtracts from the health attribute when it collides with the bullet.
  • blenderartistblenderartist Member Posts: 32
    That's what it currently does, except when say like 3 bullets hit it at once, then it only subtracts 1 instead of three. I my current game I have a power-up that gives you three shots. its kinda useless though if the enemy only registers one hit when all three hit.
Sign In or Register to comment.