Friday, November 11, 2022
HomeGame DevelopmentEasyJoystick|EasyTouch|EasyCamera - Cocos Creator

[Totally Free]EasyJoystick|EasyTouch|EasyCamera – Cocos Creator


Hello, All.
I’m Kylin, I’m so glad to be right here to share my new challenge with you.

It’s KylinsEasyController

Completely free to get from Cocos Retailer: https://retailer.cocos.com/app/en/element/4207

Cautions

Growth Setting

  • Cocos Creator: v3.6.2
  • Programming Language: TypeScript

A Easy Introduction

EasyController may be seen as a mix of EasyTouch, EasyJoystick, and EasyCamera.

A easy drag-and-drop and configuration will will let you management digital camera rotation and character motion in your telephone and pc.
move.gif

camera.gif

jump.gif

Most important Options:

  • Digital joystick
  • Keyboard and mouse occasions handler
  • Character Controller(transfer,leap,animate and collide with objects and so on)
  • Digital camera Controller(ThrePersonCamera,FreeCamera)

Steps to make use of

joystick.jpg

Add digital joystick

  1. Drag the ui_joystick_panel prefab from the EasyController folder to the Canvas.

  2. The inexperienced space within the decrease left nook of the digital joystick is the motion space, when clicked on this space, the motion controller will seem to regulate the character motion. (When customers press the W, A, S, D keys, they’ll additionally management the character motion)

  3. The purple space is used to regulate the digital camera, when click on and transfer on this space, you possibly can function the digital camera rotation, when the 2 fingers press and transfer, you possibly can alter the digital camera remark distance.

  4. When urgent the house bar, you possibly can set off the character’s leap operate.

Add CharacterController

  1. Drag the CharacterController element within the EasyController folder to the character object.

  2. If the character is to be concerned in a bodily collision, ensure that the character has a Collider element and a RigidBody element.

  3. If the character must play animations, please ensure that the character node has animation element.

  4. Parameters of CharacterController:

  • velocity Ahead motion pace
  • jumpVelocity Upward pace on the time of leaping
  • maxJumpTimes The utmost variety of jumps, 0 means can’t leap, 1 means can solely leap as soon as, N means can leap N instances repeatedly.
  • idleAnimationClip Animation clip used for idle state
  • moveAnimationClip Animation clip used for transfer state
  • jumpBeginAnimationClip Animation clip used for leap start state
  • jumpLoopAnimationClip Animation clip used for leap loop state
  • jumpLandAnimationClip Animation clip used for leap finish state

ThirdPersonCamera

  1. Add the ThirdPersonCamera element to the digital camera node that must be managed, normally the Most important Digital camera.

  2. Parameters of ThirdPersonCamera:

  • goal The goal to be adopted, normally the character node.
  • lookAtOffset Offset of the goal place.
  • zoomSensitivity Sensitivity when zooming digital camera
  • lenMin Minimal remark distance
  • lenMax Most remark distance
  • len Default remark distance
  • rotateVHSeparately Whether or not the horizontal and vertical instructions are rotated individually, when turned on, solely horizontal or vertical rotation might be carried out on the identical time.
  • tweenTime tween time, Unit: second

Programming Guides

  1. When the person operates the digital joystick or presses the keyboard or mouse, the corresponding occasion might be dispatched, and the occasion is dispatched by director.getScene().

  2. Record of occasions:

  • EasyControllerEvent.MOVEMENT Dispatched when shifting
  • EasyControllerEvent.MOVEMENT_STOP Dispatched when cease shifting
  • EasyControllerEvent.CAMERA_ROTATE Dispatched when rotating digital camera
  • EasyControllerEvent.CAMERA_ZOOM Dispatched when
  • EasyControllerEvent.JUMP Dispatched when leaping
  1. In your individual script, use director.getScene().on to hearken to the corresponding occasions.


RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments