Actor won't stop colliding.

dre38wdre38w Member Posts: 79
edited November -1 in Working with GS (Mac)
My code seems solid because it works for one actor but not the other. I have an enemy set up so that when the player jumps on top of it set self.dead to true on the enemy. The collision detection is inside a rule saying when dead is false collide with so and such. So that would assume that it wouldn't collide when it's true correct? But the thing I noticed is if it's already colliding with the objects and it turns to true it won't stop colliding. Any ideas?

Thank you.

Comments

  • svnsvn Member Posts: 445
    dre38w said:
    My code seems solid because it works for one actor but not the other. I have an enemy set up so that when the player jumps on top of it set self.dead to true on the enemy. The collision detection is inside a rule saying when dead is false collide with so and such. So that would assume that it wouldn't collide when it's true correct? But the thing I noticed is if it's already colliding with the objects and it turns to true it won't stop colliding. Any ideas?

    Thank you.

    What do you mean "it won't stop colliding?"
  • hotMagichotMagic Member, PRO Posts: 266
    Do you by chance have the player set to collide with the enemy? because even if turn it off from the enemy side, they'd still collide. Only one has to have the rule.

    My second guess would be that if it's just standing on the object, that's considered a collision by the engine and the next one wouldnt collide. I've never tried this test, but it may help...
  • dre38wdre38w Member Posts: 79
    @svn - Like what I want it to do is fall through the object it's colliding with. Which is the floor. It seems that if it's still touching the floor it won't go through but if it stops touching it for example jumps then goes back down again it goes through. Another weird thing is that when the PLAYER dies the enemy falls through even if the enemy is still touching the floor. That part I do NOT get. I see no connection between the player's death and the enemy's collision thing.

    @hotMagic - No, I only have collision detection on the enemy not the floor. But what do you mean by your second guess.

    Oh and I have Accelerate on which is what I'm using for gravity and what I was hoping to still use to make the enemy go down through the floor after they die. Just in case you needed to know.
  • svnsvn Member Posts: 445
    Here's an idea: In the Rule section, tell it When attribute "self.dead" is true" and don't put any behaviors. In the otherwise section, put another rule: when attribute "self.Dead is false" and put the collide behavior. Hope it helps.
  • hotMagichotMagic Member, PRO Posts: 266
    dre, by my second guess, I mean, have you tried to remove the collide rule when they are not touching, and THEN touch? Like, assign it to a keystroke for debug purposes, and then hit it. Just as a test to see if it's your logic or the way the collision is handling things.
  • dre38wdre38w Member Posts: 79
    @svn - Yeah tried that. Didn't work.

    @hotMagic - Still not following but I simplified this to just the rule with collision a timer to turn off after a set time and an actor with accelerate and it worked fine. That's weird because that SAME method is on my player but it won't work. But I do have player input and such so maybe that's conflicting? I don't know.
  • cwictechnologiescwictechnologies Member Posts: 1
    @dre38w- I'm having a similar problem. I think its a bug in game salad.

    In my game, I have a jump through platform that simply compares the players Y position to the platforms Y position and adjusts a boolean self.fallthru appropriately (true if no collision, false if collision). That boolean is then used to control the rule that decides if the platform collides with the player. However, in certain situations, the boolean self.fallthru will be true yet the player and the platform still collide.

    In your last post did you say you were able to get around it with a timer or something? If so how?
  • dre38wdre38w Member Posts: 79
    @cwictechnologies - Yeah I guess it might be a bug. I wasn't sure because I simplified it to nothing but the collision on off thing. But whenever I put user input it stops working. But anyway the way I got around it with what I was doing is I just spawned an Actor in place of the actor I wanted to collide with. I would've really liked to avoid that but it is what it is I suppose.

    By the way sorry I didn't reply earlier. I've been very busy. haha
Sign In or Register to comment.