Changing restitution problem

iTopGamesiTopGames Member Posts: 71
edited April 2012 in Working with GS (Mac)
Hi GS Guys, i got a problem with changing the restitution of my actor, its original restitution is set to "0", so i want it change its restitution and image in a specific point of the game, so i created a boolean game attribute called "bounce" and a rule in the actor that says:

When bounce is true:
Change Attribute: self.Physics.restitution to 1

Change Image: Blah blah

Then a put a button actor with a rule:

When touch inside:
Change Attribute: game.bounce to true

But it doesn't work, sure i did something wrong, if anybody could tell if it's Ok or Wrong, or another way to do it, i would be happy :)

Thanks

Best Answer

  • simo103simo103 Posts: 1,331
    Accepted Answer
    @iTopGames .. you can't change the Physics during gameplay so you will need to be creative to come up with the effect you want. One way would be to spawn a duplicate actor with restitution =0 and destroy the original actor.

Answers

  • theCodeMonsterstheCodeMonsters Member Posts: 359
    So is the problem that it's not changing in the first place? Or that it's not changing back?
  • iTopGamesiTopGames Member Posts: 71
    It is not changing in the first place.
  • iTopGamesiTopGames Member Posts: 71
    Yes i thought that before but i think the best way was changing the attribute, thanks for telling me that the physics can not be change during the game play, that is what i need to know from the beginning of my game :)
Sign In or Register to comment.