Animating after a collision (noob here)

dorme1dorme1 Member Posts: 11
edited November -1 in Working with GS (Mac)
Hello I'm working on my first game. I'm trying to have one actor kind of shrink/compress when another actor hits it. (think bouncing ball on a spring) I'd like the "spring" to compress when the ball hits it. I set up a rule that when spring collided with ball to play the compression animation but when the collision happens it just flashes an image of the animation. I'm sure I'm going about this entirely wrong. I'm trying to think how to tell gs "once the collision occur" where I think it's "when the collision occurs. Any help would be appreciated. Thank you.

Comments

  • RedlerTechRedlerTech Member Posts: 1,583
    Create a boolean attribute called collision at false

    Make A rule: When Actor1 collides with Actor2 change game.collision to true

    Make A rule: When game.collision = true, animate

    Matt :D
  • dorme1dorme1 Member Posts: 11
    Awesome! That works great! But it only does the animation once ( the ball may keep bouncing on the spring until input is received) what am I missing?
  • AppsRacKAppsRacK Member Posts: 346
    dorme1 said:
    Awesome! That works great! But it only does the animation once ( the ball may keep bouncing on the spring until input is received) what am I missing?

    you need to reset the bool after it trigger that way it will trigger again when the ball hits it.
  • dorme1dorme1 Member Posts: 11
    Ok. How do I go about that? I tried resetting it to false but it didn't work.
  • AppsRacKAppsRacK Member Posts: 346
    Make A rule:
    -->When game.collision = true, animate
    --->add a timer attribute
    ---->after 0.5 (change to whatever suits you)
    ----->change attribute game.collision = false

    :)
  • dorme1dorme1 Member Posts: 11
    Cool! It works great! Thanks so much for the help guys!:)
  • RedlerTechRedlerTech Member Posts: 1,583
    No problem :D

    _________________________________________________
    Full Game Creation Service
    1 On 1 Project Help
    1 on 1 GameSalad Tutoring
Sign In or Register to comment.