Problems with 'Moveable'
DrGlickert
Member Posts: 1,135
I want an enemy to be moveable when he's alive, and I want him to not be movable when he's dead.
I have a self.attribute that's called DEAD, which is set to false.
When the enemy runs out of life, that attribute is set to true.
I have a rule on the enemy;
RULE: If self.Attribute.Dead = false THEN
Collide with objects of tag type Collidable Objects
Change Attribute Self.Movable to TRUE
OTHERWISE
Change Attribute self.Moveable to FALSE
Sounds good, right? But the enemy doesn't move. Even if moveable is set to true (I put a Display Text on him to see what was going on and the moveable does get changed to TRUE when he's 'alive' and it does get changed to FALSE when he's killed).
Again, he doesn't move. Even if his 'moveable' is set to true. How do I get him to actually move with that rule?
I have a self.attribute that's called DEAD, which is set to false.
When the enemy runs out of life, that attribute is set to true.
I have a rule on the enemy;
RULE: If self.Attribute.Dead = false THEN
Collide with objects of tag type Collidable Objects
Change Attribute Self.Movable to TRUE
OTHERWISE
Change Attribute self.Moveable to FALSE
Sounds good, right? But the enemy doesn't move. Even if moveable is set to true (I put a Display Text on him to see what was going on and the moveable does get changed to TRUE when he's 'alive' and it does get changed to FALSE when he's killed).
Again, he doesn't move. Even if his 'moveable' is set to true. How do I get him to actually move with that rule?
Comments
physics aren't changeable when the game is in motion unfortunately. I believe you are going to need a duplicate actor that has moveable set to false and then when the collide happens it puts the unmoveable actor in the place of the moveable actor (ie: move one in from off screen and the other from in screen to off screen).
A real pain I know but I had the same issue in a block exploding project I have as a WIP.
Additional thought but untried: You could try creating a self.DeadX and self.DeadY attribute and set those values on death and then also constrain the actor self.positionx to DeadX and also for Y). Not sure if that will be a clean kill or if it will have jittery movement though since I haven't tried it)