Forum

[Sticky] How To: MOBILE CONTROLS to TPCST Third Person Cover Shooter Template  

  RSS

satchell
(@satchell)
Member Moderator
Joined: 3 months ago
Posts: 5
03/02/2019 2:10 pm  

How To: MOBILE CONTROLS to TPCST - PT 1

https://youtu.be/ftaDWDL3OMI

Third Person Cover Shooter Template

Standard Assets

  1. Assuming you have already imported the Third Person Cover Shooter Template, Import the Unity Standard Assets Cross Platform Input components.
  2. Drag the DualTouchControls and MobileSingleStickControl prefabs into the Third person cover.scene.
  3. Drag the MobileJoystick to the DualTouchControls. Delete the Move touch Area. (It can be used if you prefer it over the joystick.)
  4. Create a panel use the rect transform to anchor it to the bottom right corner. Use the Rect Tool to position it in the lower right of the screen. Move the Jump button into the new panel we just created.
    Duplicate the Jump button rename it Shoot. Edit the text object of the new Shoot button from "JUMP" to "SHOOT". On the ButtonHandler.cs component edit the Name field from "Jump" to "Fire". Duplicate the Shoot button rename it Zoom. Edit the text to "ZOOM". On the ButtonHandler.cs component edit the Name field to "Zoom".
  5. Open the ThirdPersonInput.cs and add "using UnityStandardAssets.CrossPlatformInput;" on line 3. Change "Input" on lines 191, 192, 227, 228, 252, 253, 285, 288, 294, 297, 488, and 489 to "CrossPlatformInputManager". Comment out lines 474 - 486 and line 491.
  6. Back to the buttons on the Zoom button delete the two pointer events and Add a New Pointer Click Event Type. Add three events to the pointer Click. Drag the Zoom button to the first two events. Set the first event to trigger the ButtonHandler.SetDownState. Set the second event to GameObject.SetActive and ensure the bool is deselected. Rename the Zoom button to ZoomIn. Duplicate the ZoomIn button rename the new one ZoomOut. Drag ZoomOut into the third event of the ZoomIn button and set it to GameObject.Setactive and ensure the bool is checked. Now do the same thing with the ZoomIn on the ZoomOut button.
  7. On the Main Camera disable the Mouse Lock Component.

How To: MOBILE CONTROLS to TPCST - PT 2

https://youtu.be/qtodBxDZLTY

This topic was modified 3 months ago by satchell

ReplyQuote
Share: