You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our game has world-spaced Labels for various tiles/objects. As you click on a label, it'll toggle to the next label, which involves replacing that label with a new one.
So what has to happen consistently without flickering, is this:
Old Label removed <- works fine
New Label inserted into scene <- works fine, sorta.
"MouseOver Detection" - MouseRay cast to find New Label via Unity's "Physics.RaycastNonAlloc()".
#3 normally works, but about every 6th time, the Physics Plane we have inserted into our Nova Labels, misses -- as though the plane is not yet inserted into the Physics system.
So there is a sporadic race condition here that we need to eliminate. The Nova UI system is the one that places this Label into World Space, and thus the Physics Plane, used for MouseRay intersection detection.
Is there a NovaUI call that we can make to force a Label to fully UPDATE it's world position, including the Physics geometry attached to it, so that Unity's "Physics" system will consistently see it?
====
What happens in our game is the MouseOver/Hover logic is used to "enlarge" the billboard, and this needs to happen the same-frame as the new billboard is added to the scene. But since the MouseOver detection is failing for this first frame (about 1 in 6 times) -- it shrinks the billboard size back to normal size, and then the next frame, MouseOver works, and it is then enlarged again.
So we see a quick 1-frame size flicker. It happens to frequently for a production quality game.
Any tips/hints?
Notes:
We are doing the UI Label swap in LateUpdate().
Then MouseOver detection then happens during Update() for the next Frame.
Most of the time, the Physics is in place, except for 1 in 6 frames, inside the Editor mode (and flickers).
Here's a quick video, where I'm clicking the Label, and each click toggles the focus object between "Town" to "Ctzn". At the 8 second mark, you can see the Flicker. During this flicker, you can also see the tile behind this one outline in Magenta during that flicker -- as our Physics Raycast, which can no longer see this Label, instead thinks you are hovering on the tile behind this one.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Our game has world-spaced Labels for various tiles/objects. As you click on a label, it'll toggle to the next label, which involves replacing that label with a new one.
So what has to happen consistently without flickering, is this:
#3 normally works, but about every 6th time, the Physics Plane we have inserted into our Nova Labels, misses -- as though the plane is not yet inserted into the Physics system.
So there is a sporadic race condition here that we need to eliminate. The Nova UI system is the one that places this Label into World Space, and thus the Physics Plane, used for MouseRay intersection detection.
Is there a NovaUI call that we can make to force a Label to fully UPDATE it's world position, including the Physics geometry attached to it, so that Unity's "Physics" system will consistently see it?
====
What happens in our game is the MouseOver/Hover logic is used to "enlarge" the billboard, and this needs to happen the same-frame as the new billboard is added to the scene. But since the MouseOver detection is failing for this first frame (about 1 in 6 times) -- it shrinks the billboard size back to normal size, and then the next frame, MouseOver works, and it is then enlarged again.
So we see a quick 1-frame size flicker. It happens to frequently for a production quality game.
Any tips/hints?
Notes:
Most of the time, the Physics is in place, except for 1 in 6 frames, inside the Editor mode (and flickers).
Here's a quick video, where I'm clicking the Label, and each click toggles the focus object between "Town" to "Ctzn". At the 8 second mark, you can see the Flicker. During this flicker, you can also see the tile behind this one outline in Magenta during that flicker -- as our Physics Raycast, which can no longer see this Label, instead thinks you are hovering on the tile behind this one.
flicker-NovaUI1.mp4
Beta Was this translation helpful? Give feedback.
All reactions