Forum rules - please read before posting.

DoT in Background

hello, I work on a scifi game. When Player does not have Helmet in inventory he should get Damage over Time. I made a trigger, run in Background with the following action. But it only substract - 10 and nothing more

https://imgur.com/a/JKggOd1

Comments

  • edited December 2023

    Because the Check only runs once, it should go back to the first node, from (3) to -> (0).

    But i think that would affect the whole map, so if the Player starts without a helmet, it immediately takes points away. You'd have to put make multiple Triggers outside of "safe" areas.

    I don't know much about performance, but that way it loops forever, because the Player is always in that area.

  • I put conntection to 1 like you mentioned but still only run once :(

  • edited December 2023

    Hmmm sorry, just to be clear - did you connect it to the very first node, where your "Start" on the top left is, not (1).

    The actionlist should look like this, and it worked when i tried it out. Make one exactly like this, and try if it works on your end:
    My value for the global health variable is an integer with a value of 100.

    And if it works add your additional check.

    You also have to remember to make an On Exit Trigger that deactivates this, for situations when you enter a building or something like that (e.g. Action List: Pause). Else it just runs, until you have a helmet in your Inventory.

  • What are your AC/Unity versions?

    As your Trigger is set to Continuous, the Actions should be designed to run once (i.e. no looping), with the expectation for it to be run again if the Player is still inside.

    Re-order your Actions so that it runs in the order:

    • Inventory: Check
    • Variable: Check
    • Variable: Set
    • Engine: Wait

    And stopping the list after the latter. If the Player is within the Trigger after it completes, the ActionList should restart and run again.

  • Unity 2022.3.15f1 and latest AC version. Thank you I try that.

  • edited December 2023

    @ChrisIceBox Thank you it works :D

Sign In or Register to comment.

Howdy, Stranger!

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

Welcome to the official forum for Adventure Creator.