Timer Bug

liamoliamo Member Posts: 191
edited November -1 in Working with GS (Mac)
hi guys,i'm working on my jump control (still:( ) and I'm nearly done, now i just have to get my actor back down...

The problem is that I have a timer set up to turn 'Jump?' back to 0 after 0.1 seconds, but it doesn't work.

Any help would be much appreciated

P.S I am using the accelerate method, the linear velocity method isn't working for me, and the accelerate method looks better.

Comments

  • steve86steve86 Member Posts: 806
    Hey There.

    There are many jumping examples in the new+ tab of the GS creator. Just search for jumping in there and open some projects and see the coding. There are many ways to achieve this. Choose the one that best fits your game.
  • liamoliamo Member Posts: 191
    Thank you for the suggestion but most of those use the linear velocity or interpolate methods, i just want to know why my timer isn't turning the attribute back to 0 and a way to fix it or another method, thank you again.
  • SAZ_1SAZ_1 Member Posts: 397
    Add gravity to your character... Eg. Accelerate direction down 1000 then tell the jump to change it's acceleration to up say 400, it will automatically go down itself then
  • liamoliamo Member Posts: 191
    thank you SAZ_1, but i just need a way to fix the problem with my timer not turning the attribute back to 0 after 0.1 seconds.
  • liamoliamo Member Posts: 191
    Bump
  • liamoliamo Member Posts: 191
    Hey guys, I have a rule that says
    If attribute Jump? = 1
    after 0.1 seconds
    Change attribute Jump? to 0

    For some reason this doesn't work, and the timer doesn't seem to do anything. Any help would help.

    Liamo
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    I'm having the same issue with the timer as well, liamo. Although, I can get it to work by itself to change a custom attribute, but when I use it to try and change a behavior, like the velocity of an actor for 2 seconds, it just doesn't respond, and actually breaks the script so the actor doesn't even accelerate like it did before. I just want it to do it for 2 seconds, but the timer doesn't work.

    So as a workaround, I'm using an endurance meter. I'm using the method from the CookBook page that tshirtbooth made about health meters, but altering it so it decreases with a timer while an attribute remains true, instead of collisions. And that attribute remains true as long as you are pressing a button. I haven't gotten to the testing part with a live actor to see when the attribute reaches 0 the linear velocity returns to normal, but testing the timer with a display text is showing that it "should" be working.

    So what i'm experiencing is the timer won't work to change a behavior directly, but I can get it to work by the timer changing a custom attribute, and then tying an actor to that attribute, and then execute behaviors based on those changes. It's more logic, and unnecessary scripting, but it's a workaround for me at least.
  • liamoliamo Member Posts: 191
    Thanks slickzero I'll try that. Tshirtbooth, il check the instance connection with it's prototype, its small little things like that which causes things like this :)
    Liamo
Sign In or Register to comment.