Reset Scene not resetting a moving object that kills me when I collide with it.

dwibredwibre Member Posts: 192
I have an enemy that moves left to right I am used magnitude to stop the enemys movement when my hero is within 60 of the enemy. if hero collides with the enemy hero dies and scene resets with (reset scene). But when I go back after reset the enemy is still stationary.

However if hero dies by something else then the enemy resets.

I think that as the reset happens my hero is still being registers within 60 of the enemy and so the enemys movement is stopped.

Any ideas how to reset an object after a death collision?

Comments

  • JarrenHJarrenH Member Posts: 206
    Is your enemy using any game attributes that aren't being reset? Those wont get reset with the reset scene behavior.
  • dwibredwibre Member Posts: 192
    No only self.attributes
  • JarrenHJarrenH Member Posts: 206
    Maybe try moving the actor to more than 60 away from the enemy, then reset scene?
  • dwibredwibre Member Posts: 192
    Nope that didn't work what I have managed to do which works is add a timer to the motion. If distance is < 60 every 1 second self.motion.linear.velocity.x = 0. Then after reset it all works ok. No idea why but its a work around. If anyone can explain why this works or has a better way let me know
Sign In or Register to comment.