my actor floats to the top??? help please

Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
edited November -1 in Working with GS (Mac)
Im trying to make my actor jump by making a button and i got that part working thanks to some guys on the fourm(thanks!) but the problem is when i press the jump button he jumps but then he jst floats up to the top he doesnt come back down? i cant figure it out can someone please help me thanks!

Comments

  • Marc_n_SophMarc_n_Soph Member Posts: 111
    Hey m8, Im only just learnin myself, but ill try and help!!

    Two ways to make your actor come back down, dont know which one you prefer to use, either make sure gravity on Y is set to about 270 or so (dont know why thats just what I use) on the scene attributes, then, assumin you have a boolean for "jump pressed" true or false, put the jump acceleration on a timer

    rule
    game.jump = true

    timer
    for 0.4 seconds
    accelerate 90 degrees relative to scene

    The other (and recommended) way is NOT to use gravity, but to put a downward acceleration on your actor to simulate gravity. Probably less processor hungry than than usin gravity, dont know just read it somewhere!!

    I realise this is a bit vague, but as I say, im only just learnin myself!!

    Hope this helps

    Marc
  • KamazarKamazar Member Posts: 287
    Just switch on gravity under "Game Attributes". Adding an acceleration behavior really isn't less processor hungry. It'd be even more so than just adding gravity if you end up having multiple actors and you use that behavior for every one. You shouldn't even be worrying about optimization and this stage, yet. Just learn how to use the software.

    So... switch one gravity to something like 300.

    When Spacebar is pressed:
    For 1.5 seconds (check run to completion)
    Accelerate upwards at 200

    And that's all there is to it. Tweak to your liking ;)
  • Hipster_Owl_StudiosHipster_Owl_Studios Member, PRO Posts: 214
    thanks a lot guys i got it to work i appreciate the help!! if u feel like i can help with anything jst let me know and give me a shout out on my profile thanks! :)
Sign In or Register to comment.