How to rotate while a key is held down

What Wick Editor Version are you using?
1.9 web app

Describe the Problem
I dont know how to make a object rotate while a key is held down

What have you tried so far?
i wrote this but it dose not work.
if (isKeyDown("q" || "TURNLEFT")) { this.rotation(+10) }

arrow that rotates when key pressed12-30-2020_5-11-34PM.wick (2.3 KB)
Does this help?

Also, is “TURNLEFT” defined as something?

If you do want to use TURNLEFT, then you could use this:
project.turnleft and project.turnright12-30-2020_5-16-18PM.wick (2.3 KB)

I didn’t check the file, but I think this code might work better:

if(isKeyDown("q")|| isKeyDown("left")){
this.rotation+=10;
}

thanks for the help!

1 Like

It just said this:

 if (isKeyDown(project.TURNLEFT)) {
        this.rotation -= 10;
    }
    if (isKeyDown(project.TURNRIGHT)) {
        this.rotation += 10;
    }
    project.TURNLEFT = "left";
    project.TURNRIGHT = "right";