Author Topic: slider problem  (Read 8301 times)

taichiu727

  • Guest
slider problem
« on: June 26, 2013, 02:46:32 AM »
so i was trying to add ngui to my menu, so first i click on my menu and click widget tool to make the slider, somehow to slider won't slide left and right, it just stays there

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: slider problem
« Reply #1 on: June 26, 2013, 10:52:48 AM »
The slider doesn't do anything in edit mode. Only in play mode.

if you make the foreground sprite a filled sprite, you can fake the effect by dragging on that instead, because that works in edit mode.

taichiu727

  • Guest
Re: slider problem
« Reply #2 on: June 27, 2013, 03:24:57 AM »
of course i know it won't move in edit mode = = doesn't work if i click play.. i also watched the tut and did the same thing but didn't work

Malzbier

  • Jr. Member
  • **
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 93
    • View Profile
Re: slider problem
« Reply #3 on: June 27, 2013, 03:29:30 AM »
Are you sure that the slider is on the correct layer?
The layer of the slider object have to match the Event Reseiver Mask at the UICamera.
If this does not match the slider cant get any interaction events.

taichiu727

  • Guest
Re: slider problem
« Reply #4 on: June 27, 2013, 09:41:36 AM »
so you need to change the layer of the slider, to the same as the camera?

Nicki

  • Global Moderator
  • Hero Member
  • *****
  • Thank You
  • -Given: 33
  • -Receive: 141
  • Posts: 1,768
    • View Profile
Re: slider problem
« Reply #5 on: June 27, 2013, 05:40:40 PM »
No, it has to be the same layers as the event mask setting on the UICamera component.

taichiu727

  • Guest
Re: slider problem
« Reply #6 on: June 28, 2013, 10:33:23 AM »
ok thx for helping but what if i am using the default main camera but not the ngui's? i already tried attaching the same scripts but doesn't work for me

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: slider problem
« Reply #7 on: June 28, 2013, 03:52:08 PM »
You need a UICamera component on the camera you need to be able to send out NGUI events. Without it, there won't be any events. Also, whatever receives events needs a collider. No collider = no events. Check the FAQ.