Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: danthat on February 10, 2014, 07:07:15 AM

Title: UIPanel 'snapping' to position when moved in code
Post by: danthat on February 10, 2014, 07:07:15 AM
I have a "Marker" object. It's a UIPanel, with a child UISprite and UILabel, being drawn in world space. The panel object's position is moved manually in a circle around the player, to point at a target object.

Code itself works fine, but something in nGUI is forcing the panel to 'snap' to a grid, and I cant find where. NGUI->Options->Snapping is off.

What's causing this jerky, jump behaviour? It only happens in nGUI panels, not other types of in-world sprite.

Ta,

@danthat
Title: Re: UIPanel 'snapping' to position when moved in code
Post by: danthat on February 10, 2014, 07:10:52 AM
Typical, fixed it within seconds of asking for help.

Problem was the objects were on a GUI layer. I made a new one called "InWorldGUI", and shifted them to that and it seems to work fine.

Is there some sort of default setting for layers called "GUI"?
Title: Re: UIPanel 'snapping' to position when moved in code
Post by: ArenMook on February 10, 2014, 05:08:16 PM
The snapping option is for moving the widgets in the scene view -- they can snap to the edges of others.

If you're doing world GUI, make sure that it's drawn using the main camera, not the UI camera. UICamera event handling is set to "UI" rather than "World" by default, which changes certain behaviour.