Can't Slow Object Down

RattleheadRattlehead Member Posts: 485
edited November -1 in Working with GS (Mac)
Hi everyone,

I have a simple ball that bounces around my scene and when it collides with a power-up, it speeds up by increasing the value of a global variable. I have that part nailed down... when it collides with the power-up, the ball does speed up.

Where I have a problem is that I can't seem to slow it down. The global parameter that controls the balls speed is successfully being reset down to my base speed of 200 (I put the parameter into an on-screen text output so I could monitor it), but my rule inside the ball actor that monitors the decrease in the variable doesn't seem to be taking effect. I have it set to react to "Any" changes and the second check is just the inverse of my first one check to see if the global speed variable has changed.

I couldn't find anything during a search for a possible bug in the Change Velocity behaviour. Can anyone think of what I might be missing?

Comments

  • KamazarKamazar Member Posts: 287
    What are you using to get the ball moving? Accelerate or move? Accelerate would probably override the "change velocity" behavior. If that doesn't work, than maybe have a timer set the actor's top speed after a certain amount of time.
  • RattleheadRattlehead Member Posts: 485
    Right off the bat I set the direction of the ball and the speed with the Change Velocity where Direction is equal to Random(-45,45) and the speed is set to my Current Ball Speed global variable which starts the game at 200.

    When it collides with my power-up actor, I have the power-up actor change Current Ball Speed.

    Back inside the ball actor I have a rule that states when Current Ball Speed is not equal to a local variable called Speed Check which is always set to 1. The idea was this internal variable would never change and therefore the rule would always be true and execute the rest of my rule which just runs another Change Velocity behavior.

    But saying that, I just installed the latest change and now it's not increasing in speed any more either.

    Back to the ol' drawing board I guess.
  • RattleheadRattlehead Member Posts: 485
    Interesting, I just replaced Change Velocity with Accelerate and you were correct; it did pick up the speed increase. I'll keep playing with it and post what I found worked so its documented.

    Many thanks Kamazar!
  • synthesissynthesis Member Posts: 1,693
    You can also use a dynamic variable in the drag behavior to manipulate the "braking" effect.
  • RattleheadRattlehead Member Posts: 485
    Hey, that's a great idea. I'll give that a shot! Thanks Syn.
Sign In or Register to comment.