-
To start from scratch, you'll need some knowledge of the following nodes: Joystick, Force, and Rotator.
-
If you're using premades, there are no prerequisites!
Do you want to make your character move with a joystick? This is possible by adding some logic.
The easiest way to do it is by using our premade characters. These already come with the logic included, and will move when you use the joystick!
https://wiki.hypehype.com/how_to/joystick.mp4
- Open the Asset library and search for “player.” For this example, add the Platformer Player.
- Go to playtest by pressing the button on the bottom right of the screen.
- Move around using the joystick.
And that's it, now you have a playable, moving character.
- Add a character from the Asset library. For this example, add a Blank character.
- Add the following nodes:
- Joystick
- Force
- Rotator
- Open the Rotator node, and make the player its Target.
- Set the Operation - Set Rotation.
- Now, open the Joystick and drag a link from Move: Angle to Rotator - Euler Y, and convert the link type. This will make the character rotate with the joystick.
- Select the Force node and rotate it so the arrow is pointing in the same direction as the character is facing.
- Make the player its Target.
- Toggle on Local Force and Reset Speed.
- Now, open the Joystick and drag a link from Move: Magnitude to Force - Amount, and convert the link type. This will make the character move around with the joystick.
- Set the Move: Magnitude - Max Value to 5.0.
- Playtest. You can move the player around with the joystick. Does it look weird? It's moving while standing still!
- Go back to the editor, and open the Joystick. Drag a link from Touch Start to the character, and select Character Animation - Animation = Run. This will make the character change its animation to running while moving around.
- Now, drag a link from Touch End to the character, and select Character Animation - Animation = Stand Idle. This will make the player stand still once you stop moving it with the joystick.
- Playtest again. Everything should be working now!
- When using a premade character, you can change its model by selecting it and opening the details panel, then tapping on the model. Make sure you select a similar model, as the logic is set up for this specific size.
- Using the premade is recommended at the beginning. You can use them as a first step to study logic.
Pro Creator Tip: Instead of changing the Magnitude in the Joystick manually, you can use the Math Operator node and multiply the Magnitude. This will make it easier to set up power ups in the future.