how do i get this working? i know why it doesnt.

0 favourites
  • 7 posts
  • hi.

    when i press a, my character walks left and plays the left walking animation.

    the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)

    however, it doesn't like me trying to do 2 things at once when i press A.

    if anyone knows how i can get this working, i would be very grateful :)

    the relevant event sheet and sprites:

    i.imgur.com/YjMeVRe.png

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • hi.

    when i press a, my character walks left and plays the left walking animation.

    the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)

    however, it doesn't like me trying to do 2 things at once when i press A.

    if anyone knows how i can get this working, i would be very grateful :)

    the relevant event sheet and sprites:

    http://i.imgur.com/YjMeVRe.png

    Judging from what I'm seeing, it seems that you don't have an event where holdinggun becomes = to 1.

    Did you create an event where, lets say if player is on "collision with gun" then "set value HoldingGun=1"?

    Otherwise the animation won't work because HoldingGun never becomes equal to 1. You need an event where the global variable "HoldingGun" can become equal to 1.

  • hi.

    when i press a, my character walks left and plays the left walking animation.

    the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)

    however, it doesn't like me trying to do 2 things at once when i press A.

    if anyone knows how i can get this working, i would be very grateful :)

    the relevant event sheet and sprites:

    http://i.imgur.com/YjMeVRe.png

    If you need more help then quote my last message so I get an update on your forum post

  • > hi.

    > when i press a, my character walks left and plays the left walking animation.

    > the sprite changes once i've picked up the gun, and i am trying to make it show the different animation if (a is pressed && holdinggun == 1)

    > however, it doesn't like me trying to do 2 things at once when i press A.

    >

    > if anyone knows how i can get this working, i would be very grateful :)

    >

    > the relevant event sheet and sprites:

    > i.imgur.com/YjMeVRe.png

    Judging from what I'm seeing, it seems that you don't have an event where holdinggun becomes = to 1.

    Did you create an event where, lets say if player is on "collision with gun" then "set value HoldingGun=1"?

    Otherwise the animation won't work because HoldingGun never becomes equal to 1. You need an event where the global variable "HoldingGun" can become equal to 1.

    Yeah that's in the "purchase" section, it happens when you are touching the gun and you press E.

    i.imgur.com/pwAGkcp.png

    here are the aiming and purchase classes

  • bumping, sorry, i'm still not sure about how to fix it

  • retrodude < that's how alerts work in those forums, not via quoting.

    ziggurati: you should post your whole capx rather than just a few screenshots.

    As it is, the issue might be with the way you setted your animations, but without the full capx, no way to be sure.

    Also you might want to use sub events to check the value of holdinggun and apply the correct animation accordingly.

  • retrodude < that's how alerts work in those forums, not via quoting.

    ziggurati: you should post your whole capx rather than just a few screenshots.

    As it is, the issue might be with the way you setted your animations, but without the full capx, no way to be sure.

    Also you might want to use scirra.com/manual/128/sub-events to check the value of holdinggun and apply the correct animation accordingly.

    ah, thank you! i now have the A keypress as an event with 2 variable checks as sub-events. it works fine, thanks for the help

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)