- Home /
How to use correctly IsPointerOverGameObject with two differen gameObjects ?
Hi guys, I'm using C#,
It's a game for Android so I am using touch screen.
I got a problem, I have two buttons on my screen, if I touch on the right, my character go to the right, if I touch to the left, he go to the left. But I have to retouch the screen, I just want to slide from a corner to the other without leaving the finger off from the screen. I was using EventSystem.current.IsPointerOverGameobject() but it works only for event sytem I guess it's not the right way.
I can explain it more precisely with simply say I want to "overmouse" one of the two sprite to go to the direction I want, and if I want to go to the other way, just overmouse the other sprite
Thank you for helping me guys, and sorry for all the mistake I made, I'm not an englishspeaker :s !
Answer by Tsonerof · Oct 22, 2016 at 10:35 PM
I find the answer.
In your sprite, you put an event trigger, and you add a pointer Enter and a pointer Exit. When you will put your finger on the pointer enter it will activate the script and will you move away from the sprite it will turn it off.