2D Toolkit Forum

2D Toolkit => Support => Topic started by: kliqingk on May 27, 2013, 09:20:16 am

Title: How to get tk2dAnimatedSprite by MouseUp?
Post by: kliqingk on May 27, 2013, 09:20:16 am
I can get a transform using Class Ray and Class RaycastHit. And Then I want to get a tk2danimatedSprite instance when I press the mouse button. How to do it?Please help me.
Title: Re: How to get tk2dAnimatedSprite by MouseUp?
Post by: unikronsoftware on May 27, 2013, 11:53:28 am
If you're using ray/raycast, you will need a collider on the animated sprite to be able to raycast. The best thing to do is apply the tk2dButton script to it and work your way from there. That script uses Raycast to pick the button using mouse / touch.