Arrowkey Movement using applyforce

Hello, I am fairly new to coding and would like to know how to use the apply force command and apply torque command to move my character when the up and down arrow is pressed and to rotate it when the left and right arrows are pressed. I tried using a different method of movement but it didn’t work. The animations are also bugged so the character will not go idle after the up and down arrows are pressed. If someone can help my fix my script it would be much appreciated. Here is the link to my game: https://playcanvas.com/project/1061106/overview/mining-mania and the script I coded is called stickman movement.

@John_Delbaere Thank you for posting a different topic. Looking at your project I am unsure what the goal is. I see this motorized drill and a character in your scene. Looks like the drill follows the mouse movement and the character is be effected by arrow keys maybe. Could you offer a little more information about what the end goal is?

I think a really good project to look at is this one.
https://developer.playcanvas.com/en/tutorials/third-person-controller/

Do you want to move the character like the tutorial using arrow keys? What about the drill?

I’m planning on making the drill character drill into rocks and such and the more rocks it drills the more damage it takes, this is where the stickman comes in, I want to make the player able to switch between the drill and the stickman with a keypress but currently I am having trouble making the stickman able to move forward and backward. The up and down arrow keys are for moving forward and backward and the left and right arrow keys are for turning the stickman clockwise and counterclockwise. Currently I am happy with how the drill moves and I just need help moving the stickman.

@John_Delbaere Have you looked at the tutorial above? You can replace the WASD key mapping with your arrow keys and reuse the script in your project.