★ wanayoo — archive 1999 https://github.com/TouchScript/TouchScript/issues/207Nouvelle recherche | Portail wanayoo
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check the current touched GameObject? #207

Closed
ankit7sethi opened this issue Feb 8, 2016 · 2 comments
Closed

How to check the current touched GameObject? #207

ankit7sethi opened this issue Feb 8, 2016 · 2 comments

Comments

@ankit7sethi
Copy link

@ankit7sethi ankit7sethi commented Feb 8, 2016

I tried using TouchManager.Instance.GetHitTarget, but couldn't get the GameObject which it is touching.

@RicardoGuzmanVelasco
Copy link

@RicardoGuzmanVelasco RicardoGuzmanVelasco commented Feb 8, 2016

In the Tap Example, the cube checks if is touched. Take a look.

@valyard
Copy link
Contributor

@valyard valyard commented Feb 10, 2016

You probably are not doing it TouchScript way.
You need to add a gesture to an object. This gesture will get hits from touches and react. Your code should subscribe to gesture's events and do something when they fire. In this case this question will be irrelevant.

But in general TouchManager.Instance.GetHitTarget should work. It returns Hit object which has Target property you can use.

@valyard valyard closed this Mar 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.