Collision problem
FatalCrest
Member Posts: 113
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
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
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
(I can't use the Destroy behavior because my enemy respawns after 30 seconds)
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
My work is following what you have there.
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