I have three events.
On sprite A created -> create sprite B
On sprite B created -> create sprite C
A, B, and C each has a number "myValue." How do I make sure they all have the same myValue?
There are many instances of A, B, and C. Each set of 3 should have the same myValue.
Develop games in your browser. Powerful, performant & highly capable.
I just use a global, and set the global before creating the object.
Thanks for the reply. Can a global cause a race condition?
For example A1 is created with my value = 1 and A2 is created with my value = 2 at the same time. What should the global be?
Set myValue when creating A, then On Create A->create B, set B.myValue = A.myValue, etc.
Hi Blackhornet. Unfortunately construct 2 does not work that way. By the time I can set B.myValue, C is already created and it doesn't have access to A.myValue.
set a global "count" value at zero
one event > Add 1 to global count
set val to global
On Create B->create C, set C.myValue = B.myValue,