GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Problem with jumping and ducking

ZwireZwire Posts: 165Member, BASIC

Hi there,

I made 2 touch controlls. A jump and duck control. Everything works accept that my player actor can still duck while jumping.

Anyone know how to block the duck touch command during jumping?

Comments

  • SocksSocks London, UK.Posts: 12,822Member

    Make the rule for the duck include the condition: jump=false

  • GnarlyGnarly canadaPosts: 840Member
    edited April 2016

    Here is one way of doing it.....Demo
    https://www.dropbox.com/s/grmkn3ybshp7gkq/jump duck .zip?dl=0

    You can't jump and duck at same time.....

  • ZwireZwire Posts: 165Member, BASIC

    @Socks said:
    Make the rule for the duck include the condition: jump=false

    Socks, I made a condition attribute jump is false for the rule for the duck but it didnt work.

    The player can still duck in mid air.

  • ZwireZwire Posts: 165Member, BASIC

    @gattoman said:
    Here is one way of doing it.....Demo
    https://www.dropbox.com/s/grmkn3ybshp7gkq/jump duck .zip?dl=0

    You can't jump and duck at same time.....

    Thank you for the download but it isnt the same. The player in your download isnt jumping but just moving up en down. My player is jumping en able to do a duck animation/command in midair which I dont know how to turn off.

    Any other ideas?

  • SocksSocks London, UK.Posts: 12,822Member
    edited April 2016

    //

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,904Member
    edited April 2016

    @Zwire said:

    @gattoman said:
    Here is one way of doing it.....Demo
    https://www.dropbox.com/s/grmkn3ybshp7gkq/jump duck .zip?dl=0

    You can't jump and duck at same time.....

    Thank you for the download but it isnt the same. The player in your download isnt jumping but just moving up en down. My player is jumping en able to do a duck animation/command in midair which I dont know how to turn off.

    Any other ideas?

    You must have a condition for when the player touches the ground right? So in the rule that allows the duck add the ground condition to it. So if the player is not touching the ground it can't duck. Watch my video on how rules work.

  • ZwireZwire Posts: 165Member, BASIC

    @Lost_Oasis_Games said:

    @Zwire said:

    @gattoman said:
    Here is one way of doing it.....Demo
    https://www.dropbox.com/s/grmkn3ybshp7gkq/jump duck .zip?dl=0

    You can't jump and duck at same time.....

    Thank you for the download but it isnt the same. The player in your download isnt jumping but just moving up en down. My player is jumping en able to do a duck animation/command in midair which I dont know how to turn off.

    Any other ideas?

    You must have a condition for when the player touches the ground right? So in the rule that allows the duck add the ground condition to it. So if the player is not touching the ground it can't duck. Watch my video on how rules work.

    Yeah that sounds like its it! Where can I find the ground condition? I cant find it in the condition list.

    Can I find it somewhere here: attribute: self.player.(position????)

  • GnarlyGnarly canadaPosts: 840Member

    Steady. It's seems complicated but it's easy to learn.

    Sent pm

  • GnarlyGnarly canadaPosts: 840Member

    You have to create a ground condition.....

    If player touches collides with floor

    change attribute duck to true

    otherwise:

    Change attribute duck to false

    So if player is touching the ground he can duck. As soon as he jumps he leaves the ground. He is no longer touching or colliding so the otherwise rule kicks in and turns duck to false....

    Make sense?

  • ZwireZwire Posts: 165Member, BASIC

    @gattoman said:
    You have to create a ground condition.....

    If player touches collides with floor

    change attribute duck to true

    otherwise:

    Change attribute duck to false

    So if player is touching the ground he can duck. As soon as he jumps he leaves the ground. He is no longer touching or colliding so the otherwise rule kicks in and turns duck to false....

    Make sense?

    Yes it worked. Many many thanks for your time and help man!

  • GnarlyGnarly canadaPosts: 840Member

    Good for you for figuring it out.

Sign In or Register to comment.