TouchScript | Complete multi-touch solution | iOS library
kandi X-RAY | TouchScript Summary
kandi X-RAY | TouchScript Summary
When working on a project for mobile devices or PCs with touch input you will soon require basic gestures like tap, pan, pinch and zoom — they are not hard to implement manually using Unity API or using a package from Asset Store. The hard part is to make these gestures work together, e.g. to have a button with a tap gesture placed on a zoomable window. This is where you will need TouchScript — it makes handling complex gesture interactions on any touch surface an effortless job.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of TouchScript
TouchScript Key Features
TouchScript Examples and Code Snippets
Community Discussions
Trending Discussions on TouchScript
QUESTION
I have a prefab that is instantiated when the user buys the item from my In-game store, how ever many is instantiated, the all of prefab has a start position of a certain position. The prefab can be dragged around the scene using this TouchScript package I found online! My issue: I want to play the prefab's animation every time the user is dragging the prefab around the screen, I attempted this by creating a RaycastHit2D function that would allow me to detect if the user has clicked on the prefab's collider, script below:
...ANSWER
Answered 2018-Aug-01 at 16:12I faced a similar issue with platforms in my 2D game. The solution I would suggest is to create a GameObject
that acts as the current item you wish to animate, and a LayerMask
that acts as a filter for which objects your raycast can hit. You can use this LayerMask
in conjunction with the Physics2D.Raycast
API, which has an overload method that takes a LayerMask
as a parameter.
Start by creating a new layer, which can be done by going to the top right of an object in your scene and accessing the "Layer" box. Once you've created a new layer (I called mine "item"), make sure your prefab's layer is assigned correctly.
Then, create an empty object in your scene, and attach this script to it. On that object you will see a dropdown menu that asks which layers your raycast should hit. Assign it the "item" layer; this ensures that your raycast can only hit objects in that layer, so clicking on anything else in your game will produce no effect.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install TouchScript
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page