Hello Guest

Author Topic: How to get tk2dAnimatedSprite by MouseUp?  (Read 4087 times)

kliqingk

  • Newbie
  • *
  • Posts: 14
    • View Profile
How to get tk2dAnimatedSprite by MouseUp?
« 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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: How to get tk2dAnimatedSprite by MouseUp?
« Reply #1 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.