Author Topic: NGUI doesn't work when camera is moving, but is fine when camera is stationary  (Read 2122 times)

mushu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Hi there

I'm developing the control system for a platformer and am using NGUI. Everything works correctly until I enable my camera to follow the character. That is to say, when the camera is static all the NGUI widgets etc all react as they should but when the camera is moving, buttons don't pick up every click and the UIDragObject I'm using as a joystick snaps to the side of the clipping bounds of it's panel.

Again, this all works fine if the camera doesn't move.

Each NGUI object has a UIAnchor set to use the camera and the camera has a UICamera script on it.

Do you have any ideas what the problem could be and/or how to solve it?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
You should never be moving the UI camera with the player. Keep is stationary. Use a different camera to draw your UI than your game.

mushu

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
That solved it, thanks!