Problem with jumping and ducking

ZwireZwire Member, PRO Posts: 182

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.Member Posts: 12,822

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

  • GnarlyGnarly canadaMember Posts: 840
    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 Member, PRO Posts: 182

    @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 Member, PRO Posts: 182

    @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.Member Posts: 12,822
    edited April 2016

    //

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    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 Member, PRO Posts: 182

    @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 canadaMember Posts: 840

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

    Sent pm

  • GnarlyGnarly canadaMember Posts: 840

    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 Member, PRO Posts: 182

    @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 canadaMember Posts: 840

    Good for you for figuring it out.

Sign In or Register to comment.