Stopping Collisions

LBGLBG Member Posts: 277
edited January 2012 in Working with GS (Mac)
Hi,

I have an enemy actor that when destroyed I want to no longer collide with my player actor. I have tried to do this by saying:

When self.health > 0 collide with player

I then assumed it would stop colliding with the player. Unfortunatley it still bounces off the player. Should this work?

Many thanks

LBG

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Actor 1 and Actor 2

    In Actor 1
    self.health is set at say 5

    Rule

    When overlaps or collides with Actor 2
    Change attribute self.health to self.health - 1

    New Rule

    When self.health > 0
    Collide with Actor 2

    In Actor 2
    Nothing except your normal rules, don't do any collisions etc.
  • MotherHooseMotherHoose Member Posts: 2,456
    edited January 2012
    I don't know what you use to trigger changes in the self.health attribute …

    might help if you have a Display Text behavior on the enemyActor … Text: self.health
    to monitor the health changes

    @};- MH
  • LBGLBG Member Posts: 277
    @Beefy
    I have it set up much like you say. I even have the display texts, like you say MotherHoose, in the scene so I can debug it. All the values being returned are what I expected.

    - I have just worked it out (kinda). After the enemy died I was setting the enemy speed to 0 by changing the LinearVelocityY and X values to 0. This didn't seem to work and even allowed collisions to still occur - no idea why. I have now done this by setting the maximum speed of the enemy to 0 and it works! - No collisions.... odd to say the least.

    Thanks for the help though. My game is going to be Beta tested soon so if there are going to be any further issues then that will bring thme to the fore to be dealt with.

    Cheers

    LBG :)
  • LBGLBG Member Posts: 277
    Actually scrap that. It's now not working. I have no idea what's going on....
  • LBGLBG Member Posts: 277
    By using DisplayText rules I can see that all of the right rules are triggering. It seems that sometimes it takes a while for the collsion rule to be halted (10% of the time). As there is no consistency with when it doesn't work I can only assume it's a bug or technical error with the engine.
  • LBGLBG Member Posts: 277
    It works most of the time. I really need it to be 100% for release though.... I'm going to flag this in technical and in the mean time try a few work arounds.

    LBG
  • MotherHooseMotherHoose Member Posts: 2,456
    as the human eye can not detect things at the speed of hundredths of seconds …

    in the Actor 1 rule:
    When self.health > 0
    --Timer: After: 0.01 second
    --Collide with Actor 2

    @};- MH
  • LBGLBG Member Posts: 277
    Just tried it and it makes no difference... Still very unreliable.

    I have now posted this in tech support so hopefully GS will come to the rescue :)

    LBG
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Occasionally collision detections won't occur if the velocities are too high. I suggest do a screen record so we can see what is going on.
  • LBGLBG Member Posts: 277
    Velocities are quite low. I'll try to do a short video

    Thanks

    LBG
Sign In or Register to comment.