Replace it with system > compare global variable, with the same info. You can add it somewhere else first and drag it under it then delete the old one. Or press C, add it as a condition and delete the old one after.
OH DAMN I just forgot delete instance variables again. you are really my savior. even my teacher didn't want to help me. Thanks a lot!
is it like this? nothing is happen... or maybe i should delete unnecessary event.... but which one ' ')
You didn't need to delete the instance variable though...revert those changes if you can so you return to your normal events. Replace the instance variable food with the global variable in events as you go.
how can i replace with global ? this event, that attached to instance variable, how to make it using global variable?
so now i did it.... the hp number keep continuing last number from prev layout. the next problem is... i have deleted an instance variable which trigger another event. i changed it to text2's variable (food/hp) but it cannot trigger the other events (disable platform, visible popup, etc)
Develop games in your browser. Powerful, performant & highly capable.
this is instance variable on text
No you just need them somewhere in the project and it's fine. You replaced the instance variable on player with the global so it should be working now?
i was using instance variable or this event. can i replace that compare instance variable?
ooh ohh this event gone after i deleted instance variable
Probably better not to use persist behaviour on the player, although you can make him global in properties. Easiest way though is to make the hp a global variable, you can change it and it keeps its state between layouts!
global... are they those green things? should I copy paste them to the other layout?
Instance variable will reset when instance is created on start of layout. You can make it 'Persist'. Or you can use a global variable for HP which is usual and remains the same across layouts.
interesting... how to make it persist?
I put max number of hp to 5
1 layout > hp decreased to 3
when the cat runs to another layout the hp should be still at 3, but it comes back to 5
anything is wrong with the code?
When you say running with minus, do you mean the character is still moving instead of stopping? Or do you mean it did not reset the layout?
moving cannot stop it
Member since 8 Apr, 2020