|
I'm using a simple script to replace the windows cursor with a custom one. However, before turning the windows cursor off, I noticed that my cursor lags behind it when I move the mouse. It's not gamebreaking, but it's annoying. I doubt it's related to performance considering I'm testing this on a scene that only contains a Camera (with this script attached, of course). Is this one of those things that are hard-coded into the engine or is there an alternative method that yields no lag? Thank you.
(comments are locked)
|
|
After checking you Cursor position code, i'd say you better use Update() to update cursor postion and OnGUI() only to display it. That way you delete the lag caused by OnGUI calls. I tried using a separate GUITexture with the following script: var textureSize : int = 64; function Update(){ As you see, it's all done in Update() and sadly the lag persists, so it may be an engine issue after all. Thank you for your help :)
Dec 09 '11 at 07:31 PM
OCASM
(comments are locked)
|
|
The OnGUI() function is known to be slow. Unity 3.5 will hopefully have an improved GUI system. But, I do not think it is the slowness of this function that is causing the issue. I do think that it is a performance issue but not what you are thinking of. The Of course, when you hide the Windows cursor, the lag would barely become noticeable. Thank you for your reply. I added a GUITexture to the scene with the following script Seemed just as laggy. Perhaps the problem is with how the mouse input is recorded by the engine, who knows.
Dec 08 '11 at 08:49 AM
OCASM
(comments are locked)
|
