laggy custom mouse pointer help

i am currently using a script that i found of the internet that changes my default mouse pointer to something else when playing my game. the only problem with it is that it it laggs a bit which is really anoying please can anyone help this is the script.

var cursorImage : Texture;

function Start() { Screen.showCursor = false; }

function OnGUI() { var mousePos : Vector3 = Input.mousePosition; var pos : Rect = Rect(mousePos.x,Screen.height - mousePos.y,cursorImage.width,cursorImage.height); GUI.Label(pos,cursorImage); }

Like I said in your other post, just use this - it works 100% for me and its easy to apply:

var myCursor : Texture2D;
var cursorSizeX: int = 32;  // set to width of your cursor texture
var cursorSizeY: int = 32;  // set to height of your cursor texture

function Start(){
Screen.showCursor = false;

function OnGUI(){
    GUI.DrawTexture (Rect(Input.mousePosition.x-cursorSizeX/2 + cursorSizeX/2, (Screen.height-Input.mousePosition.y)-cursorSizeY/2 + cursorSizeY/2, cursorSizeX, cursorSizeY),myCursor);

hi, i have a standard Matrix4x4 resizing my whole GUI.

when this is applied to my mouse, it happens to be slide away from the pointer

how can this be?

this is the matrix

' public static Matrix4x4 ResizeGUI() { Vector3 tOffset = new Vector3 (0.0f, 0.0f, 0.0f); Quaternion tRotation = Quaternion.Euler(0, 0, 0); Vector3 tScale = new Vector3(Screen.width / 1024.0f, Screen.height / 800.0f, 1.0f); return Matrix4x4.TRS(tOffset, tRotation, tScale); } '

update 17.39 28/03/2011 i solved by arranging the mouseinput

' GUI.DrawTexture ( new Rect(Input.mousePosition.x, Screen.height - Input.mousePosition.y, 32, 32), normalCursor); '

pointer is still lagging a bit by the way

hope it helps!

Try disabling vertical synchronization to update the frames faster:

QualitySettings.vSyncCount = 0;