News: Enjoy our Christmas offer 30% off on our latest package Tower Defense Level Kit http://u3d.as/m7h

  • December 10, 2018, 09:17:49 AM

Login with username, password and session length

Author Topic: Want To Integrate Easy Touch With RFPS Prefab  (Read 574 times)

Offline d@ntesw@p

  • Newbie
  • *
  • Posts: 4
Want To Integrate Easy Touch With RFPS Prefab
« on: July 06, 2017, 03:41:04 PM »
Hey There I am New Here . Ans The Subject Says I want To integerate The Easy Touch 5 With The Realistic FPS Prefab . I am So Confused On What To Do . But Anyways I Managed To Make The Joystick Work With RFPS By Editing Input to ETCInput . But I Want All The Controls to Be Touch Controls And The Most Imp Problem Is To Make Camera Controls I Don't Want Separate Joystick For Camera But I Want Only Left Side Of Screen TO Act As Camera Control SO If User Drag There It Controls Camera .Also On The Left Side I Want SOme Buttons For Like Jump Shoot Etc So I Want The Camera Control Area TO Not To Act When Clicking That Buttons. SO How Can I Do All This . THE RFPS Have All The Scripts Prewritten So How To Link Easy Touch 5 With It Without Modifying The Original Script Other That That "Input" To "ETCInput" Thing. BasicallyI Want The Touch Controls To Be Like Modern Combat 5 Game Or Any Similar FPS Game. Please Help Me.

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Want To Integrate Easy Touch With RFPS Prefab
« Reply #1 on: July 06, 2017, 04:58:04 PM »
Hi,

You have already started to do what it takes by replacing Input by ETCInput. I think you'll have understood you can do the same thing with buttons ...

1/ The author of RFPS has correctly thought its packae so that it can be used from the outside, that is to say that you will be able to call methods from the controls. There is API document with this package ?

2/ The author of the RFPS did not foresee that his package is controllable, so you will have to modify the code of the RFPS. You will therefore have to isolate the block of code in the functionality you are interested to either apple it from an easytouch control, or to modify its code




Offline d@ntesw@p

  • Newbie
  • *
  • Posts: 4
Re: Want To Integrate Easy Touch With RFPS Prefab
« Reply #2 on: July 06, 2017, 05:25:40 PM »
Ya API Are There .
This Is The Code For Camera Control With Mouse Which I Want To Change To Touch Based Like If I Drag Anywhere On Screen It Controls Camera Except Over The Buttons Or Joystick .Can You Help Me On How TO Modify This Code as I have done for movement for joystick as you can see . but for camera I want to cancel Mouse movement and replace with Like a touchpad or The Whole Screen Which Mask The Joystick Or Button SO If I Drag From Any Part Screen Which Don't have buton or stick It Controls Camera . But If I Touched a Button Or Joystick It Should Not Control Camera

                //scaled radial deadzone for joysticks for smooth player movement ramp from deadzone
      
             moveInput = new Vector2(ETCInput.GetAxis("Joystick Move X"), ETCInput.GetAxis("Joystick Move Y"));
         if(moveInput.magnitude < deadzone){
            moveInput = Vector2.zero;
         }else{
            moveInput = moveInput.normalized * ((moveInput.magnitude - deadzone) / (1 - deadzone));
         }
         
//// FOR Camera Control
        lookInput = new Vector2(Input.GetAxis("Joystick Look X"), Input.GetAxis("Joystick Look Y"));
         if(lookInput.magnitude < deadzone){
            lookInput = Vector2.zero;
         }else{
            lookInput = lookInput.normalized * ((lookInput.magnitude - deadzone) / (1 - deadzone));
         }

   //combine mouse and axis input for player looking (accelerate axis input)

         lookX = Input.GetAxisRaw("Mouse X") + AccelerateInput(lookInput.x);
         lookY = Input.GetAxisRaw("Mouse Y") + AccelerateInput(lookInput.y);
« Last Edit: July 06, 2017, 05:33:26 PM by d@ntesw@p »

Offline Nicolas

  • Administrator
  • Hero Member
  • *****
  • Posts: 792
Re: Want To Integrate Easy Touch With RFPS Prefab
« Reply #3 on: July 08, 2017, 01:45:38 PM »
Hi

As you say, you can use a touchpad (look at the complex FPS example), and in this case just have to do as with the joystick, replace Input with ETCINPUT using the names of axes.

I can not understand what blocks you from script?

Offline d@ntesw@p

  • Newbie
  • *
  • Posts: 4
Re: Want To Integrate Easy Touch With RFPS Prefab
« Reply #4 on: July 11, 2017, 03:54:32 PM »
Ya Thanks I Now Finally Able to integrate all Of The Important Controls For Touch . Now I Got One Problem . I Got Some Buttons Over The Touch Pad So When I Touch A Button The Button Works Fine And When I Drag On Touch Pad It Also Works Fine But Now The Problem Is That If I Drag On The Touch Pad And Cross over A Button Then The Touch Pad input Gets Canceled And I Have To Re Start The Drag Touch .

SO Is There Any Way By Which The Drag On Touch Pad Don't Get Cancelled If Finger Cross Over or Move Over A Button ?