Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
What am I doing wrong here? Text object allways returns 111, even thou it should be touch.x.
If I put the "Set text to Variable1" right after I change the variable. Text object displays the touch.x
You can not use a Local here. It needs to be Global. "On touch" is a trigger, which happens outside of the event loop, so the scope only lasts for event 2. Events 3+ run on the next tick, which will reset the Local back to it's default of 111.
Thank you very much for clarifying this out. So does this mean that we can't change local variables with triggers?
You can change local variable, but they work in specific scope of events and when that scope ends local variable is automatically reset.
Read here to get more info about local variables https://www.scirra.com/manual/83/variables
You can set local variables to "static" so their value persist.
Develop games in your browser. Powerful, performant & highly capable.
Thank you very much. This was a great help!