Step 1

Triggering movement with the Keypress Event

Watch the video tutorial here

In this example, we're using the Topdown Tanks pack from the Marketplace.

From inside your level, find a character (or any game object) that you want to use as your top-down player. Right-click on it and select Add Script.

We want to make the character move around by pressing the arrow keys on the keyboard. To start this off, we need the block "When backspace/delete pressed" from Events. Drag this block out into the workspace, and click on "backspace/delete" to change the key to right arrow.

To get the character moving to the right, grab the "set velocity x" block from Physics, and drag it into the event block. Set the velocity to 200 (you can tweak this number if you'd like).

Click Play to make sure this script works so far. When you press the right arrow key on your keyboard, the character should start moving to the right.

results matching ""

    No results matching ""