Guides
Log In

V-Pad Customize

V-Pad Customize

You can control the V-Pad using ScreenTouchPad and ScreenButton.

You can turn V-Pad On/Off from UIController_TouchPad_Horizontal, and UIController_TouchPad_Vertical Prefab.

Below is how it looks with Touch Pad turned off. You can turn the Jump Button off the same way.

2880

Double Jump Setting

πŸ‘

Double Jump

You can start using it from World Package 1.1.6.


Setting Up through V-Pad Prefab


Please set up as below if you're using Double Jump through V-Pad Button.


  1. Click on the UIController_TouchPad_Vertical or UIController_TouchPad_Horizontal prefab.
421
  1. Select Jump from the Prefab list.
2880
  1. As seen below, click the + button from OnPointDownEvent() and drag the UIController_TouchPad_Vertical or UIController_TouchPad_Horizontal from the Object slot to set up.
2880
  1. Click the No Function part, then set up the UIZepetoPlayerControl > DoubleJump() function.
454
  1. If it's set up like below, it's a success.
700

How to Set Up through Custom Button


If you are going to create your own button to use, please add the script as seen below.

import { ZepetoScriptBehaviour } from 'ZEPETO.Script';
import { Button } from 'UnityEngine.UI';
import { CharacterState, ZepetoCharacter, ZepetoPlayers } from 'ZEPETO.Character.Controller';

export default class JumpButton extends ZepetoScriptBehaviour {

    public shotButton: Button;
    private zepetoCharacter: ZepetoCharacter;

    Start() {
        // Create character
        ZepetoPlayers.instance.OnAddedLocalPlayer.AddListener(() => {
            this.zepetoCharacter = ZepetoPlayers.instance.LocalPlayer.zepetoPlayer.character;
        });
        // Add script component
        this.shotButton.onClick.AddListener(() => {
            if (this.zepetoCharacter.CurrentState === CharacterState.Jump) {
                this.zepetoCharacter.DoubleJump();
            } else {
                this.zepetoCharacter.Jump();
            }
        });
    }
}

Example

2408