Author Topic: Clickable UITexture  (Read 2855 times)

rbreve

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Clickable UITexture
« on: March 14, 2014, 09:09:51 PM »
Hi, I have been struggling to add just a simple clickable uitexture, I don't want to add a button widget, just a texture that is clickable, I added the void OnClick() but it doesn't work, I can't find a simple example on how to do it, can anyone help me? thank you.

This is what I do, I create a UITexture, then attach a collider, then attach a button script, drag the game object with the onClick public void function to the notify field, but it still doesn;t work, what am I missing?

Update:

Ok so I made a new scene and did the same and it works, I wonder why it wouldn't work on my existing project.
« Last Edit: March 15, 2014, 01:28:11 AM by rbreve »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Clickable UITexture
« Reply #1 on: March 15, 2014, 03:49:50 PM »
It's case sensitive. "onClick" is not the same as "OnClick".

rbreve

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Re: Clickable UITexture
« Reply #2 on: March 15, 2014, 10:16:17 PM »
I fixed it, I had to enable Raycast Hit Triggers  on the Camera .