Non moveable

GingerBGamesGingerBGames Member Posts: 390
edited November -1 in Working with GS (Mac)
Hello GS'ers,

I have a bad guy, and when my good guy get's within x distance of the bad guy, the bad guy runs towards the good guy, and starts to punch him. My problem is that if my hero keeps walking, then the bad guy is pushed with the good guy. I've tried a rule that when within x distance to change the bad guys self.physics.movable to 0, and false, but it doesn't stop the hero from being able to just push him. How can I make this happen?

Thank you.

Comments

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    Turn off physics on the enemy, and have him interpolate to the hero's x and y when he gets within that certain distance.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    if your not already, you should be using magnitude to detect the distnace between the bad guy and good guy
    .


    for your question the moveable attribute cant be changed in game.

    You can constrain the motion linear x adny y to stop all movemnet, but you should not have to do that at all. If you have your rules the bad guy set up with magnitude like inthe video i , youll be able to put whatver you want to happen once the player gets to far away from him again in the otherwise section of the rule with the mgnitude attribute,
Sign In or Register to comment.