Coder Social home page Coder Social logo

Comments (6)

valyard avatar valyard commented on July 19, 2024

Sorry, I don't get what you are trying to do.
Can you describe what objects you got and what behaviour you want?
Like 1. I press here 2. I move fingers there 3. I expect this to happen.
Thanks.

from touchscript.

 avatar commented on July 19, 2024

You are right, I wasn't very specific. Just read it again, what I was trying to say:

I have several instanced prefabs with the same behaviour in a scene. I want them to trigger their delegates, if I swipe over them. For example, I press somewhere on the screen and then start to move my finger arround, If I hit any object in the process it should respond to my input.

I tried all implemented Gestures and did not check against their GestureState to see, if something triggers. But the way I did it only when I startetd tapping/pressing/swiping on an object, only the first one reacted after I was done with the Gesture.

from touchscript.

valyard avatar valyard commented on July 19, 2024

I see.

The problem is that to recieve touch events an object HAS to be one with a collider a touch hit. You can't start a touch over one object and transfer it to another one. You will need to group these objects into a common container and add a custom Gesture to it.

This gesture will recieve touches from all the prefabs but to get touches which didn't hit them you'll need to place a bigger collider on this container. For example this is what FullScreenTarget script does. It places a collider it the far plane of a camera.

If you got a global collider you will have to add custom collision logic to this new Gesture.

If you are not very familiar with c# programming or scripting in general and got time to wait I can code such a gesture and add it as an example to the site in the beginning of the next week.

from touchscript.

 avatar commented on July 19, 2024

I think you would be much faster and more efficient in coding the sample. If you don't find the time I would go deeper into the framework and try to find out how a custom Gesture is set up.

Thanks in Advance,
If it accounts for anything, this is worth a 5-Star rating in the store.

from touchscript.

 avatar commented on July 19, 2024

Hey,
did not hear anything new, so I guess you are not set up to code on an example? I checked out the dev-branch and the related dependencies. Builds like a charm.
So, I would built a class in the library implementing the gesture interface. I am not familiar with the used libs and still not making much of a progress.

from touchscript.

valyard avatar valyard commented on July 19, 2024

Sorry, in the middle of a tight deadline at the moment.
For your problem try doing the following: create an object with big collider, add your smaller objects to it so that this big collider overlaps them and gets all the touches, make a custom gesture (or use MetaGesture) and add it to the container object. In this gesture you can test every active touch casting rays and ignoring the big collider to get to small ones and check whether touch points intersect them.

from touchscript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.