Hi, I working in a escape room game and I don't have a player, but I have a room and I need rotate this room with a Swipe. I use Lean Touch for that, but I have issues because if I touch a hotspot it start the interaction (I think it is because is touch down). I want to know how I could I solve this with a tap event or touch up.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Welcome to the community, @gferrari.
This is on a mobile device, I take it.
Yes, interactions occur by default on the "touch down". However, it is possible to rely on a custom interaction system that instead reacts to touch releases.
See the Manual's "Custom interaction systems" chapter for more details on this topic, but here's an example script. Set your game's Interaction method to Custom Script, and paste the following into a C# script named HotspotInteractionOnUp.cs:
Attach this as a component to a new GameObject in your scene, and it should then cause Hotspots to have their "Use" interactions run when a tap is released.
Thanks so much!!
I'm a little embarrassed to ask again. It worked very well to activate the hotspot, but when I use an item it does not work with the hotspot and customscript.
If you are in context sensitive this works.
I try to do this but always I get null, Thanks for the patience...
I made this and worked... because I use tap (With lean touch thirdparty component) to interact so if I use drag and drop in the inventory I need button up.
}
I don't know if it is correct...
Generally SelectedItem should remain set when you expect it to be, but that may change if you're altering the way input is handled.
One things you could do to reduce things a little would be to refer to LastSelectedItem instead of temporarily assigning the item in your own "selectedItem" variable.