Timeline for Need Help with Hovering Mouse Code
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 16, 2015 at 10:34 | comment | added | Daleo Eaton | I did some research, and raycasting doesn't work on UI elements since there is nothing to collide with. I gave it a 2D box collider but the "hitbox" didn't match what I had used (Since the image I had used moved with the canvas, the 2D box collider did not move I assume.) Is there anyway I can use a UI.Graphic.Raycast()? I have been trying to use a Graphic.Raycast but it doesn't seem to be working either. I feel completely helpless on this, because my research on this isn't coming out very fruitful. | |
Jul 14, 2015 at 19:10 | vote | accept | Daleo Eaton | ||
Jul 19, 2015 at 2:39 | |||||
Jul 14, 2015 at 16:52 | comment | added | M0rgenstern | The "current" seems to just give you the current active EventSystem. I found something that could help you. It seems as if you have to do some raycasting: stackoverflow.com/questions/27888293/… I am sorry, I just had a quick look into Unity a few months ago, so I am not totally sure how you need to do this. I saw that this script is run by each card. That is where the problem also comes from. Each card just checks if ANY card is hovered and then animates itself. | |
Jul 14, 2015 at 13:45 | comment | added | Daleo Eaton | This is going to sound very noob of me. But I am not sure how to write something that would identify each card. I understand what it is doing. I have no idea how to rewrite this code so it works for a single card. I had though that "current" was what I needed for that but apparently that doesn't work like I thought. And I can't seem to figure out how to use "this" if it even applies. Additional Info: Each card runs this script. | |
Jul 13, 2015 at 10:09 | history | answered | M0rgenstern | CC BY-SA 3.0 |