Packaged as Android, but OnDrag(PointerEventData data) is invalid

wfr

New member
File Opsive.Shared.Input.VirtualControls.VirtualJoystick.cs and Opsive.Shared.Input.VirtualControls.VirtualTouchpad.cs. When I Packaged as Android and the OnDrag(PointerEventData data) is invalid.But when i run in editor it work. How to solve it?
 
OnDrag should be called on Android as well. Did you recently write a review on the Asset Store? If so make sure you are not using the Unity Remote as I know that doesn't fully implement all of the callbacks.

Also, instead of using the built in virtual controls I recommend using the Input System or the Control Freak integration. Those provide a lot more functionality that the old input manager code.
 
OnDrag should be called on Android as well. Did you recently write a review on the Asset Store? If so make sure you are not using the Unity Remote as I know that doesn't fully implement all of the callbacks.

Also, instead of using the built in virtual controls I recommend using the Input System or the Control Freak integration. Those provide a lot more functionality that the old input manager code.
yes, it's me. I use the real phone with Input Manager. when i run this project on real phone OnDrag is invalid. I download Input System and set Edit-->Project Settings-->Player-->Settings for Android-->Other Settings-->Active Input Handling-->Input System Package(New).But unity Console show the project was going wrong about Input Manager with many .cs script. How to solve it?
 
What is the very first error? Take a look at this page for integration with the input system:

 
It doesn't look like you performed steps 4 and 5 from the documentation. Make sure you go through each of those steps. Also, note that the demo scene requires the old input manager for compatibility reasons and will not run with the new input system. You should use a new character and scene.
 
It doesn't look like you performed steps 4 and 5 from the documentation. Make sure you go through each of those steps. Also, note that the demo scene requires the old input manager for compatibility reasons and will not run with the new input system. You should use a new character and scene.
As you described, I did not refer to the documentation. i only use demo to building the android project, and OnDrag was not work.1685610578305.png
In this documentation, where could i find 'steps 4 and 5' you described
 
Great to hear. Once you get it working if you can update your review I would really appreciate it!
 
Great to hear. Once you get it working if you can update your review I would really appreciate it!
I will if it working.
In this documentation, i remove UnityInput(step 4), but UnityInputSystem i could not found(step 5).
1685614406539.png
1685614251833.png
 
Make sure you download and import the integration (step 2). The component is included in that package.
 
Make sure you download and import the integration (step 2). The component is included in that package.
Thanks.Input System Demo was running without errors.But the old VirtualControls(example:VirtualControlsManager.cs) is still not suitable for the new input system.1685620378918.png1685620404257.png
 
That is expected - take a look at step 3 ? You should use the touch controls from the input system.
 
That is expected - take a look at step 3 ? You should use the touch controls from the input system.
I'm sorry, but I still don't know how to generate a joystick(has prefab without scripts) to control the character after read step 3
 
Since you are using Unity's touch system it doesn't require anything related to the character controller. You can follow standard tutorials such as this video:
. From the controllers perspective it only checks when an action is triggered. The video will show you how to trigger that action.

If you are looking for something that doesn't require any scripting at all I recommend Control Freak. The controller has an integration with that input asset.
 
Since you are using Unity's touch system it doesn't require anything related to the character controller. You can follow standard tutorials such as this video:
. From the controllers perspective it only checks when an action is triggered. The video will show you how to trigger that action.

If you are looking for something that doesn't require any scripting at all I recommend Control Freak. The controller has an integration with that input asset
I know this.Is your script 'UnityInputSystem.cs' not suitable for mobile devices?
 
I can only make double joystick like xbox, but not mobile.
1685730874247.png
When I use touchscreen. my first touch move will change character look at ,Although the first time I touched was joystick or a button(example:Jump).
 
Top