Collision problem

FatalCrestFatalCrest Member Posts: 113
edited November -1 in Working with GS (Mac)
So I'm having a problem with my main actor colliding with my enemies when they die

After I kill the enemy with my main actor then if my actor was still colliding as the enemy died, they both collide still, but if I back up enough and run back to where they died theres no more collision.

My work inside the enemy is simple

If enemyDead is false
Collide with main actor
(enemyDead is set to true when it dies)

I'd hate to allow that to stay in my game, please help

Comments

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Not sure where you've set when enemy dies set enemyDead to true, it's sounding like it's separate somewhere. So

    When all are valid
    When Collide with main actor
    if enemyDead is false

    change attribute enemyDead to true

    should work OK.

    Why not have the enemyDead fade out and disappaear, as an idea? Instead of the above, have

    When colliding/overlapping with main actor

    Interoplate self.enemy.Color.Alpha to 0 over 2 seconds

    Destroy.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FatalCrestFatalCrest Member Posts: 113
    is there a better way doing that besides your way?

    (I can't use the Destroy behavior because my enemy respawns after 30 seconds)
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    If you mean it "comes alive" again after 30 seconds then I see, you won't need Destroy. (But if it is spawned again then no worries, it just makes another fresh copy of the Prototype actor, but I'm sure you knew that).

    In that case, the amendment to your Ruling as I wrote should be OK for you. Haven't tested it, so if not, perhaps post back as to what might still be the prob.

    :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FatalCrestFatalCrest Member Posts: 113
    Haha I actually meant that, "comes alive." I'm still having problems though, they still collide even though enemyDead is set to true. Thing is though when I run away then run back to the place it died theres no collision...

    My work is following what you have there.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Gotcha; forget what I wrote earlier....so, from the top of my head, in the enemy actor, put

    when enemyDead is true
    Timer
    After 30 seconds
    change attribute enemyDead to false

    When all are valid
    when collide with main actor
    enemyDead is false

    .......(your "freezing" code which presumably you've done, depending on your method of moving the enemy you've used)

    change attribute enemyDead to true

    Give that a whirl, fingers crossed it'll work for you.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • FatalCrestFatalCrest Member Posts: 113
    Sorry for the really late reply but Oh my god, thank you gyroscope!! This worked, I've spent a week on this issue and its the last glitch I've found in my game! Thank you so much! I can finally work on creating levels now! :D
Sign In or Register to comment.