Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

LEAN ⚡️ Touch / GUI / Texture / Localization / Transition / Pool

Discussion in 'Assets and Asset Store' started by Darkcoder, Aug 1, 2019.

  1. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18
    Yes, but I didn't find it :( , I don't understand how to do it.
     
  2. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    As I said via e-mail, this feature is part of Lean Touch+. If you buy it and still don't understand then I can guide you better.
     
  3. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18
    Hello, I bought Lean Touch +, but it still doesn't work for me, try using "Lean Drag Translata Along", but at the moment of instantiating the object, it is not in the desired place and it scales and looks giant. Can you give me a hand please. Thank you!
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    How are you scaling the object? The LeanDragTranslateAlong component doesn't implement any scaling. If it spawns with a giant scale then you may have to adjust the scale of your prefab, but I'm not sure without more information.
     
  5. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18
    I made more tests and I realized that the object is not scaled, but invoked not where it should be, this is instantiated about 1 meter above the level of the plane where it should be, and in another position. Try several things, first remove the LeanTouch properties and the object is instantiated correctly. I realized that by selecting the place where the object should appear, it is instantiated correctly, but after more or less 0.3 seconds, it changes position, one meter above the level of the plane and in a different place.
     
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I still need more information about your setup. Please provide screenshots of your GameObject inspectors so I can see which LeanTouch components and settings you're using. If you're using LeanDragTranslateAlong then it sounds like you have incorrect ScreenDepth settings. The default DepthIntercept setting for example is not suitable for an AR scenario, because this will place your object on the XY plane, but in AR you probably have a ground plane that lies on the XZ plane, so you should use a setting like HeightIntercept instead.
     
    isasaurio likes this.
  7. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18

    Hi, this is the Prefab configuration that should be installed when you touch the screen.
     

    Attached Files:

  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    This looks fine. Is your ground plane actually at world position Y = 0? If it's offset by say 1 unit then you can adjust the Offset to be 1 in the ScreenDepth settings. If this still doesn't work then I could try testing it tomorrow.
     
  9. singyosan

    singyosan

    Joined:
    Oct 18, 2018
    Posts:
    12
    Hello, it's Lean Localization again
    I've already assigned 2 objects to a phrase "Phrase A" for 2 languages
    But when I try to use
    LeanLocalization.GetTranslationObject("Phrase A", xxx);

    It always returns the fallback one ("xxx" in the example)

    I was originally going to get the component in that object, but failed,
    so I then tried to assign that translation object to a GameObject
    but failed again...

    UPDATE
    It seems like the Object Type T can only be GameObject
    I tried this one earlier
    SomeT s = LeanLocalization.GetTranslationObject<SomeT>("Phrase A", xxx);

    it returned the fallback one

    and this one
    GameObject s = LeanLocalization.GetTranslationObject<GameObject>("Phrase A", xxx);

    this would work... but it's quite weird to work this way
    cause that means I am only able to get GameObject from all the translation

    UPDATE #2
    okay.. it was fine at first time
    but when I loaded the same level in the game again
    it goes back to returning fallback again, lol

    UPDATE #3
    did some code tracing, and the reason causes returning fallback is
    translation.Data is T

    since Data would be always categorized as Object
    it would always be false
     
    Last edited: Sep 18, 2019
    qooqinc likes this.
  10. dyangca

    dyangca

    Joined:
    Apr 10, 2018
    Posts:
    1
    Hi, I've run into a strange problem. In your examples, the "Tap To Select (3D)" gameobject has LeanSelect and LeanFingerTap, and the LeanFingerTap has a OnFinger event that references to LeanSelect. However the drop down in the inspector shows that the public method is missing <Missing LeanSelect.SelectScreenPosition>. The functionality is active when I enter play mode but I can't replicate the functionality. What's the fix to this? Thanks.
     
    projectcity3d likes this.
  11. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18
    Hello
    By giving a setting of -1 in option Z, the model appears well positioned, but, the drag does not work or rotate, in fact the object does not react to any Lean function :(
    I don't know how I would have to do it to make it work as before, a year ago I used a script called "LeanTranslateSmooth" I don't know what else to try.
     
  12. stickylab

    stickylab

    Joined:
    Mar 16, 2016
    Posts:
    92
    how if my projest using photon ,, how to replace photonnetwork.instantiate with lean pool ?
     
  13. projectcity3d

    projectcity3d

    Joined:
    Jun 11, 2019
    Posts:
    7
    same
     
  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I don't see any problem with the code. GetTranslationObject will return the fallback if your Object isn't of the T type. If you put a GameObject in there then T must be GameObject, if it's a Mesh, then it must be Mesh, etc. This should work for any System.Object, or UnityEngine.Object if the translation is filled from LeanPhrase.

    It sounds like you're mismatching types by perhaps storing a GameObject in the translation, and attempting to retrieve a component on that GameObject, which won't work with the current implementation of this method, because the GameObject itself is a separate object to any components attached to it. I could add some additional code to account for this specific scenario since it may be quite common, but this isn't an issue with the code.


    Which example? Which exact version of Unity are you using? Is this in a fresh install of LeanTouch, or are you upgrading from an older version? Are there any errors in the console?

    LeanTranslateSmooth is now the same as LeanTranslate, because I combined the smooth functionality of all components into their base versions. If the other components do nothing then either your scene doesn't have the LeanTouch component, or your object has LeanSelectable + RequiredSelectable set, but you haven't selected it so these components aren't activating.


    You would have to modify the Photon code to do this, but this is probably quite difficult so I don't recommend it. Typically online games won't have too many networked objects, so it's not too much of an issue to not use pooling in this scenario. If you really must then one easy way would be to network instantiate an empty GameObject, and then attach the pooled prefab you really want to it.
     
  15. Curlyone

    Curlyone

    Joined:
    Mar 15, 2018
    Posts:
    41
    Hello, thanks for the amazing assets, they really do help me a lot!

    However i encountered a problem in LeanTouch, "Missing" issue with same people as above.

    I got this issue in 2019.2.6 Personal. To test the issue i downloaded 2019.2.5, 2019.2.4, 2019.2.3 and created a new project in each of them. in 2019.2.6 and 2019.2.5 i got the issue however in 2019.4 and 2019.3 i do NOT get the issue.

    in 2019.2.6 and 2019.2.5 events looks like this:
    https://prnt.sc/p9sgl9

    while in 2019.2.4 and 2019.2.3 events looks like this:
    http://prntscr.com/p9t6rs

    The thing is the events that is registered actually works even though it says it is missing. In 2010.2.6/5 you can actually register events through interface while in debug mode manually, that is what i am doing it right now until solution is up. So i am guessing somehow interface serialization doesnt work properly for events in LeanTouch scripts in 2019.2.6 and 2019.2.5 (not that i am any expert on coding or unity :D )
     
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks for taking the time to test this so thoroughly!

    It looks like another fun day when Unity changes fundamental aspects of its implementation. This is caused by the SelectScreenPosition method existing twice, where the first method has the signature (LeanFinger), and the second has (LeanFinger, Vector2). In previous versions there was no problem here because they have different signatures thus the event inspectors knows which is which, but for some reason they changed it to no longer detect this difference.

    I can fix this by changing the name of the second method since it's not as important.
     
  17. isasaurio

    isasaurio

    Joined:
    Nov 13, 2016
    Posts:
    18

    Yes, when I put the script LeanTranslate can move but I can not limit the effect so that it only acts on the Z and X axes, and lets me move the object on the X and Y axes, you can help me limit the script to achieve what What I need?
    Thanks for your time.
     
  18. Asusralis

    Asusralis

    Joined:
    Oct 27, 2016
    Posts:
    11
    Hello! It seems that fingers that are returned from OnFingerSwipe have their LastScreenPosition and ScreenPosition values set to the same thing. This makes all of the delta properties zero. If this is intended, is there a better way to get the delta of a finger without having to go back through the finger's history?

    I'm below version 2.0, but I'm not sure what version exactly. Is there a place to download the latest before 2.0?
     
  19. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    If you want your object to move along a ground plane relative to the camera orientation then LeanDragTranslateAlong can be used (DragUnderAlongPlane demo scene). If you want your object to move along X and Y axes without considering the camera orientation then the LeanManualTranslate + LeanMultiSet components can be used (DragMove2D demo scene).


    This is due to the way finger up is detected, but I can change this. If you let me know your current version then I can send you a modified build. The last release before 2.0.0 was 1.7.1.
     
    LeFx_Tom likes this.
  20. Curlyone

    Curlyone

    Joined:
    Mar 15, 2018
    Posts:
    41
    I changed the second method's name but it didnt solve anything so I think misinformed you, this doesnt happen only in that particular example but in every example and also when i add leantouch scripts to my scene, every event shows 0 argument.

    This is how inspector is on my gameobject for example:
    http://prntscr.com/papzm4

    I added my methods there through debug mode, but in normal mode it cannot detect my methods so it shows missing, even though, like i said before, events works, so my methods runs properly.
     
  21. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    I see now. I just tested it and it looks like it's a bug with Unity.

    This code works fine:

    Code (CSharp):
    1. public MyEvent testEvent;
    Yet this doesn't:

    Code (CSharp):
    1. [SerializeField] private MyEvent testEvent;
    For some reason making it private and serialized like this causes it to lose its event types and break.

    [Edit] looks like someone already filed a bug report for this HERE.
     
    Last edited: Sep 25, 2019
  22. EmurKun

    EmurKun

    Joined:
    Oct 3, 2017
    Posts:
    4
    Hey, I don't know if you included this kind of features in your Lean Touch+ because I didn't buy it yet but I will, soon. I notice in your LeanSelect.cs that you didn't include hitting the top layer or the highest sorting order of the sprite. Here is the code I added to the LeanSelect.cs.
    Code (CSharp):
    1.  
    2. public float rayStart;
    3. public float rayEnd;
    4. private void Hit2DTopLayer(Vector3 point, ref Component component)
    5. {
    6.     if(component)
    7.     {
    8.         Vector3 raycastStart = new Vector3(point.x, point.y, rayStart);
    9.         Vector3 raycastEnd = new Vector3(point.x, point.y, rayEnd);
    10.         var hit2Ds = Physics2D.LinecastAll(raycastStart, raycastEnd);
    11.         int topHit = 0; //Set our top hit to a default of the first index in our "hits" array, in case there are no others
    12.         var hit2DtempSprite =  hit2Ds[0].transform.GetComponent<SpriteRenderer>();
    13.         if(hit2DtempSprite)
    14.         {
    15.             int preValue = hit2DtempSprite.sortingOrder; //Set our first compare value to the SortingOrder value of the first object in the array, so it doesn't get skipped
    16.        
    17.             for (int arrayID = 1; arrayID < hit2Ds.Length; arrayID++) //Loop for every extra item the raycast hit
    18.             {
    19.                 int tempValue = hit2Ds[arrayID].transform.GetComponent<SpriteRenderer>().sortingOrder; //Store SortingOrder value from the current item in the array being accessed
    20.            
    21.                 if (tempValue > preValue) //If the SortingOrder value of the current check is higher than the previous lowest
    22.                 {
    23.                     preValue = tempValue; //Set the "Previous Value" to the current one just changed, for comparison later in loop
    24.                     topHit = arrayID; //Set our topHit with the Array Index value of the current Array item, since it currently has the highest/closest SortingOrder value
    25.                 }
    26.             }
    27.         }
    28.         component = hit2Ds[topHit].collider;
    29.     }
    30. }
    Also, I know this kind of a stupid features I made but I made a Input System where I can interact the UI elements, 2D objects and 3D objects. A simple pseudocode like this.
    Code (CSharp):
    1.  
    2. HitUIFirst()
    3. if hasHitUI == false
    4.     Hit2D()
    5. if hasHit2D == false
    6.     Hit3D()
    7.  
    But in your LeanSelect.cs I always need to have a reference or an Instance of it in order change the "Select Using" variable. But then again, I realize that this script is in the Examples folder.

    Anyway, this is a great asset for all and I think I'm gonna use this asset for most of the projects. Right now I'm experimenting different gestures so I can have a bunch of gestures in my gesture roster.
     
  23. temresen

    temresen

    Joined:
    Jul 9, 2018
    Posts:
    29
    Hi Carlos!

    There is a missing reference on Lean Chase Rigidbody. So that we can not call set position method. Screenshot is from example project.

    https://pasteboard.co/IzaLyNI.png
     
  24. projectcity3d

    projectcity3d

    Joined:
    Jun 11, 2019
    Posts:
    7
    Hi, how to use tap and double tap at same time? For now i use:
    Lean Finger Tap with tap count 0 and tap interval 2
    and Lean Finger Tap with count 0 and tap interval 0
    As a result when i do double tap, "on position" method called 3 times, 2 for single taps and 1 for double, is it possible to not trigger single tap if double called?

    ps i use TapSpawnCount scene to test
    pss too many "taps" in reply =p
     
  25. Zahmahkibo

    Zahmahkibo

    Joined:
    Dec 31, 2018
    Posts:
    7
    Purchased today, very impressed with the asset so far. $15 seems like a steal for the breadth and depth of features.

    Hit an obstacle with the included LeanMultiSwipe example component. In the Lean/Touch+/Examles/MultiSwipe scene, the object named "LeanMultiSwipeInfo" is missing its script. The "LeanMultiSwipe" object attempts to call this script from OnFingers. I also observed that OnSwipeParallel is being invoked multiple times per swipe (at least with mouse controls, using the out-of-the-box configuration). Unsure if this is intended behavior, or if it's the result of the missing script.

    Thanks for creating this great toolkit!
     
  26. TheFlyHawk

    TheFlyHawk

    Joined:
    Mar 23, 2016
    Posts:
    58
    Missing a function
    upload_2019-10-1_4-50-13.png
     
  27. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    What if i have an image that i can drag. But that image also contains an image that i want to use to rotate the first image. King of like instantiating an object and that object has a border. On this border in the corners are images of, rotate, scale, and move. I want to be able to use this package to use the other images attached to the main image to rotate, move and scale instead of using lean on the main image. is this possible?
     
  28. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sorry for the late replies!

    Great suggestion! I've added it to the to-do list. I'll release it in an upcoming version :)



    This is most likely THIS bug, which should be fixed in these super new versions.


    LeanTouch+ includes the LeanFingerExpiredTap component (TapToRotateExpired demo scene), which allows you to do this. You can use LeanFingerTap for double tap, but if you want single tap as well then you need a different component like this to LeanFingerExpiredTap that will wait until you stop tapping for enough time so it knows you just did a single tap.


    Thanks for pointing out these issues!

    The missing script was an oversight on my part, as I recently improved this component to no longer require this additional script to demonstrate its features.

    The LeanMultiSwipe activating multiple times per gesture is also a bug that I've now fixed, luckily it should be very difficult to do on an actual touch device.


    Good question! I don't think this is possible right now, because this would require components like LeanDragTranslate, LeanPinchScale, and LeanTwistRotate to work on a different GameObject (e.g. parent), which they currently can't do. This is a good idea though, so I'll add it and send you a build tomorrow if I can.
     
    EmurKun and ErmergerdEnt like this.
  29. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    I went ahead and in the Graphics Color script, i added a game object for on select and on deselect so when the object is selected it will show the border, then i went ahead and modified the scripts to be able to rotate and drag to work with my border components. All is working well! Thank you. Your lean script was a huge help with selecting and deselecting items.
     
    Darkcoder likes this.
  30. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    Only Problem is, No matter where i touch on the screen, the object moves. So now i need to figure out in the Drag Script of yours, how to only move the target if im touching the drag icon.
     
  31. Flow17983

    Flow17983

    Joined:
    Mar 4, 2015
    Posts:
    3
    Hello we bought lean touch+,
    is it possible to use your asset for a tangible interface with capacitive markers like this:


    It would be great becouse there are not many solutions for unity.

    Best reguards,
    Florian
     
  32. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    Another question.. Lets say i have up to 5 UI images i can instantiate in the scene at once. All can be selected, dragged, scaled, and rotated. Lets call them stickers. Each sticker has a border that when selected, will appear you can the drag it around the scene and place it where you like. But once another sticker is pressed, i would like the first one to be deselected, then the border be disabled. Is this currently possible?
     
  33. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    I figured it out. I just seen the selectable objects allowed lol.
     
    Darkcoder likes this.
  34. ErmergerdEnt

    ErmergerdEnt

    Joined:
    Apr 7, 2017
    Posts:
    54
    Only thing is, using the drag on a text input is rough
     
  35. EmurKun

    EmurKun

    Joined:
    Oct 3, 2017
    Posts:
    4
    Hello, is there a significant difference in the 4 core scripts (e.g. LeanFinger.cs, LeanGesture.cs, LeanSnapshot.cs, LeanTouch.cs) between the lean touch and lean touch+?
     
  36. meowstudios

    meowstudios

    Joined:
    Nov 30, 2016
    Posts:
    9
    Really extraordinary work with the LeanPool asset, I rated a well deserved 5 stars and left an updated review as well. I was wondering if anyone had an issue with restarting the same scene (with prepooling), in some cases it lags for us and it didn't till we add the LeanPool asset, it's not doing it all the time either... maybe I am using the prepool in a bad way
     
  37. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I notice LeanGameObjectPool.TryFindPoolByPrefab is using list iteration, it could lower the performance when the user uses LeanPool to spawn particles, which usually would add hundreds of prefabs into the list and spawn them pretty often. How about using a dictionary instead, it's almost O(1).
     
  38. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Sorry for the late replies again! Perhaps this should be my username? :D

    This is on my to-do list. It may take some time though, because when I implement this I also want to implement editor tools to allow simulation for them. The current finger simulation code is fairly basic, so I might have to rewrite it or something, we'll see.


    Indeed, you would probably need the text input area to block Lean Touch. This is can be done using the LeanTouch.GuiLayers setting. I'll try and make the demo scene you describe before possible as soon as I can!


    Nope, the whole Lean/Touch folder is identical in LeanTouch+, you just get lots of new components and demo scenes built from these 4 core classes.


    Can you profile this with Deep Profiling enabled, and confirm that it's Lean Pool, and if so which methods are causing the lag?


    Thanks for pointing this out, this is a big mistake that I will fix in the next version!
     
    zhuchun likes this.
  39. TheFlyHawk

    TheFlyHawk

    Joined:
    Mar 23, 2016
    Posts:
    58
    upload_2019-10-13_12-24-53.png
    This LeanTouch+ is urgently needed to apply to the project, my project is dynamically added script, can you fix this error as soon as possible?
     
  40. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    This is a bug in certain versions of Unity that has now been fixed. You can read about it HERE.
     
  41. emanuelbjorsell

    emanuelbjorsell

    Joined:
    May 4, 2015
    Posts:
    8
    Hello,

    I have a scene where I use LeanPitchYaw on a pivot object to rotate around the camera which is a child of the pivot. And then I have pleny of LeanSelectables.

    When I click on one of the Selectables I want to create a zoom in effect so that the camera is in a specific position. I have created a new method in LeanPitchYaw to change the values Pitch and Yaw so that the pivot is looking at a certain position that I'm feeding into the method. But it does not quite work, it changes the rotation but the pivot doesn't look at the transform.

    This is my method:
    Code (CSharp):
    1.     public void RotateTowards(Transform target)
    2.     {
    3.  
    4.         Vector3 targetDir = target.position - transform.position;
    5.  
    6.  
    7.         Quaternion rotation = Quaternion.LookRotation(targetDir);
    8.  
    9.         Pitch = rotation.x;
    10.         Yaw = rotation.y;
    11.  
    12.     }
    I know that this works when I change the transform.rotation directly. But if I let it go through Pitch and Yaw it comes out a little bit of.

    How can I tell the LeanPitchYaw to rotate towards a specific point?
     
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Hey everyone,

    Version 2.0.2 of Lean Touch and Lean Touch+ have just been released!

    These include improvements to the LeanSelectable implementation, as well as changes to the way mouse/finger up is handled that should improve responsiveness.

    Let me know if you encounter any issues!


    The Pitch and Yaw values are Euler rotations in degrees around those axes, whereas the quaternion X and Y values are part of the quaternion axis, so you can't just copy them over like this.

    I recommend you look at the RotateToFinger method in the LeanPitchYaw code. This method converts the xyz direction into Pitch and Yaw values, just like you're trying to do here. You just have to replace the xyz calculation with your current one and it should work.
     
  43. emanuelbjorsell

    emanuelbjorsell

    Joined:
    May 4, 2015
    Posts:
    8
    Alright, I will check again. I tried earlier using that method, but will look at it again.

    Thanks for the reply!
     
    Darkcoder likes this.
  44. Ipefyx

    Ipefyx

    Joined:
    Mar 9, 2015
    Posts:
    1
    Hello !

    First, I'm descovering all your assets packages and actually using LeanGUI. Thank you for that, it's really usefull !

    However, while trying to use the LeanJoystick, it seem that the LeanJoystick.OnDown() and LeanJoystick.OnUp() events are not working just like that. In fact I noticed, by checking the code, that theses two events are not called at all.

    I actually just added an Invoke call of theses two events in LeanJoystick.OnPointerDown() and LeanJoystick.OnPointerUp() and it's working like that, so it's not a big deal ! But I'm wondering if I'm missing something ?


    upload_2019-10-20_14-13-55.png
     
  45. xsasoftware

    xsasoftware

    Joined:
    Sep 6, 2017
    Posts:
    24
    Hello. Just a small question. Is there a way to use RTL text ( arabic for example )?
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Thanks for pointing this out, this is a slight oversight :D

    I'll submit a new version today with this fixed. Let me know if you encounter any other issues!


    Are you referring to Lean Localization? If so, I have no idea, I just set the Text string and use standard Unity text boxes. If you let me know what changes are required I might be able to add them, but I have no experience with RTL languages.
     
  47. EmurKun

    EmurKun

    Joined:
    Oct 3, 2017
    Posts:
    4
    Hello!

    I notice in your LeanSwipe script in the Lean GUI it doesn't invoke the transitions given in the inspector. So I added the
    swipeTransitions.Begin(); at the end of the update when swiping and it's working fine right now. This is not a big deal though, the problem is where exactly to put it code. Well anyway, great asset. Keep up the good work :D
     
  48. Curlyone

    Curlyone

    Joined:
    Mar 15, 2018
    Posts:
    41
    Hello, some weird behaviour for LeanGui and LeanTouch.

    I am using LeanButton on a ui gameobject, however leanbutton itself doesnt see the clicks on it, i have to put some other ui component that allows itself to be raycasted, such as image and text, otherwise leanbutton wont see clicks on its' attached gameobject. Weirder thing is when i get finger information from LeanTouch it says the finger started on gui. So LeanGui cant see if it hit ui element while leantouch can, so thats a weird behaviour imo.

    To whoever get this behaviour i am bypassing this like this: i am giving an image component to leanbutton's gameobject and set its color to 0 alpha so that way it wont actually affect anything but will register raycast therefor leanbutton will work.
     
  49. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,404
    Good find! Yes, that's where it goes. This will be fixed in version 1.0.9 :)


    If your button didn't have a raycastable graphic on it (like Image), then what did it have to allow LeanTouch interaction?

    LeanTouch can detect presses on 2D colliders, 3D colliders, or raycastable elements (like UI).

    Whereas LeanGUI can only detect raycastable elements. If you use the PhysicsRaycaster and/or Physics2DRaycaster then both can work with 2D and 3D colliders though.
     
  50. Curlyone

    Curlyone

    Joined:
    Mar 15, 2018
    Posts:
    41
    Ohh, i guess i undestand now, i am using base gameobject and use white image in it, then i have bunch of children on them and those children has the leanbutton script on them. Leantouch was able to detect that white image but not leanbutton since its' gameobject dont have element, anyway i guess i understand the issue now :D Sorry to waste your time.
     
    Darkcoder likes this.