Using setVariable with the list of a trigger will cause the variable to update simultaneously with the list . Ergo when the triggerlist changes, the value of the variable will change as well.
Description
Description
Details
Details
- Legacy ID
- 3980780943
- Severity
- None
- Resolution
- No Bug
- Reproducibility
- Always
- Category
- Scripting
Steps To Reproduce
Place a Trigger
Act: Anybody
onAct: player setVariable ["Test1", thisList,true];
Walk into trigger > Variable will update [player]
Walk out of trigger > Variable will update again []
Event Timeline
Comment Actions
This is because array is passed by reference. You need to make a copy using +.
player setVariable ["Test1", +thisList, true];
^^^^ should do the trick.