How to set a variable to change a objects look

Fill this out this info to make it easier for the community to help you! If you don’t fill out this information, your post may be deleted or removed.

What Wick Editor Version are you using?
Ex. 1.19.2

Describe the Problem
Alright this is a specific question so I will try to lay it out in a simple way.

I want to have a cheat code menu. I already setup a questions box. Basicaly I want it so that when you type in the command ‘sonic’ it makes the sets the variable x to be 1.
By default the variable is 0. Then on the actual object, it checks to see if the variable is 1. If it is, it changes to the next scene which is a different sprite.

Right now it is not working.

What have you tried so far?
On the first scene of the project is set the variable to 0. (var x = 0;)
Then I set it so that if you said “sonic” it would set the variable to 1. (if(commandz==='sonic') { var x = 1; }
Then on the character it moves to the scene of the other sprite. if(x === 1) { gotoAndPlay(25); } else { gotoAndPlay(1); }

Do you have a Wick Editor File that we can see? Optional*
Yes! The project in question (1.9 MB)

The “x” variable in the player is a seperate one than that in the button (each object has their own variables). To have a variable connected to a clip or the object, you can use ClipName.variableName or project.variableName, then you can refer to the variable from other objects the same way.

In other words, you can use project.X instead of x

Your same project but edited.wick (1.9 MB)

Let me know if this is what you needed.

Also, your project looks great

Thanks for the help! I am on mobile rn but will check this out in the morning!

1 Like