Simple Integer Problem?

Hi, so in my game you can pick up C4 explosives. I have an integer attribute for how many explosives the player is carrying. But I can't seem to get each C4 picked up to add by 1. In my C4 actor, I have set:

When collision with player
Destroy Actor
Set game.C4Amount to +1

But getting multiple C4's doesn't add 1 each time, so player is forever stuck with just one.

I then of course have the same issue counting back down when player uses one.

Could anyone help me? Thank you

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You need to adjust it to be like this:

    When collision with player

    Change Attribute C4Amount to C4Amount +1

    So what you are doing is taking the previous value and adding 1 to it.

  • ReMasteredGamesReMasteredGames Member Posts: 101

    @jamie_c said:
    You need to adjust it to be like this:

    When collision with player

    Change Attribute C4Amount to C4Amount +1

    So what you are doing is taking the previous value and adding 1 to it.

    Of course! Thank you so much!

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You're welcome :)

  • ReMasteredGamesReMasteredGames Member Posts: 101

    @jamie_c said:
    You're welcome :)

    By the way I love your GS recipes, they taught me how to use GS!

Sign In or Register to comment.