You're probably racing them so localstorage.itemvalue is not what it should be when you grab it. Have you tried ordering them so when the first one is missing or found, check the next one?
You can use another variable and set that based on the string I guess
This should work :
Middle mouse button
or Right mouse button is down : object disable drag drop
Left mouse button is down : object enable drag drop
You can relate the object instance to the array by way of instance variable. So object.var is array.x, object.var=1 is all data at x=1.
Are you using it wrong? Show us how you're using it, let's see the event sheet.
Ah ok I see. I thought you were saying that the zeroes were unexpected. Resolved above then ^^
No problem! Just to clarify again it knows which instance of Home to use because of the conditions on the left. In Construct you can narrow down picked instances with conditions on the left. If you don't narrow it down then it picks the single instance with the lowest UID. You can also use 'for each' instances to run actions for every instance.
On the action you use system 'set value' and you should be able to use Home.x or Home.y
That looks correct, are you sure the values at array1.x=0 are not actually 0? Let's see a screenshot of array 1.
If you use the condition 'player is overlapping home' then it 'picks' the correct home object. Then with the actions on the right you can happily set the global variables to home.x and home.y.
Develop games in your browser. Powerful, performant & highly capable.
You do not have permission to view this post
Member since 5 Aug, 2013