A Question About Restitution

RHRH Member Posts: 1,079
edited November -1 in Working with GS (Mac)
Hi,

If, for example, I have a ball that falls due to gravity and I have an actor called ground at the bottom that it collides with, I have the restitution of the ball set 0.6 and the restitution of the ground set to 0. When i play the game the ball drops and bounces up and falls and bounces just how i want it to. However I want it to stop bouncing when its maximum bounce height reaches a certain amount. I can't figure out how to do this though and I have been trying for a long time. It's probably a lot easier than I am making it :(

Hopefully that is worded clearly,

Thanks for any help

Edit: I should probably add that at the moment the ball just ends up doing little bounces on the spot, it's kinda annoying

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    if you mean what i think you mean, you could do it with an attributes and a few rules. Is that bounce height going to be the same every time? If so, just create an invisible actor as a hotzone, and two attributes on the ball itself. for example, I created an attribute called stopBouncing on the ball itself, but you could probably make a global attribute as well.

    rule 1:
    when ball overlaps or collides with hotzone
    change self.StopBouncing to 1

    rule2:
    when ball overlaps or collides with floor
    AND
    self.StopBouncing is 1
    change velocity to 0

    You could also adjust this to work with a certain Y value

    when self.Position.Y is > 200
    change self.StopBouncing to 1

    and then the same rule 2

    does that make any sense?
  • RHRH Member Posts: 1,079
    Thanks, it's not quite what i mean i don't think but that should be helpful, i'm going to try something similar to that, it's not a major set back on my game it just really really annoys me :P

    Thanks
Sign In or Register to comment.