Replies: 1 comment
-
While admittedly a nuance of the layout system, this is the expected and documented behavior. Long story short is the The way to work around this is to use In your case, that would like: private void Hover(Gesture.OnHover evt) {
if(evt.Interaction.ControlID == 1) { //left hand
if(cursorLeftHand == null) {
cursorLeftHand = Instantiate(cursorPrefab, transform).GetComponent<UIBlock2D>();
cursorLeftHand.TrySetWorldPosition(evt.PointerWorldPosition);
}
}
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure if this is a bug, but I thought I'd share anyways. I'm instantiating a cursor prefab into my UIBlock2D OnHover/OnMove and I always get what seems to be a 1-frame flicker where the cursor object displays at the cursor prefab's default position. I've tried to instantiate with setting a initial position or set the proper position right after instantiation with no success. I've tried to disable the instantiated object and then re-enabling after a few frames for debugging purposes, but whenever I enable it, the cursor displays at the prefabs default position for one frame before it moves to the correct position. The cursor prefab is a single UIBlock2D that represents the UI cursor
I've just changed the cursor prefabs default position to 1000 so the flicker isn't visible, which works fine. Just curious if I'm missing anything.
Beta Was this translation helpful? Give feedback.
All reactions