x


Input.mousePosition updating?

I am having a very odd issue. I tracked it down to trying a very simple:

using UnityEngine; using System.Collections;

public class Mouse_SceneClick : MonoBehaviour {

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

    if (Input.GetMouseButtonDown(0))
    {
        Debug.Log("Clicked at " + Input.mousePosition);
    }
}

}

No matter how or where I move the mouse in the window the position always comes out exactly the same

Clicked at (196.0, 242.0, 0.0) UnityEngine.Debug:Log(Object) Mouse_SceneClick:Update() (at Assets\Scripts_HHT\Interface\Mouse_SceneClick.cs:16)

It detects the mouse and the script or it would not be detecting clicking, but beyond that I cannot get any usable information. I am using Unity 2.5 (I understand the patch dealt with a related issue but that was for Mac, I am on a PC - Dell XPS if it makes a difference). I can't upgrade to 2.6 until tomorrow since we have an investor lined up and this is the last feature I am trying to squeeze in - I don't want to risk breaking my system right before tomorrow if I don't have to.

So... anyone have a similar issue by chance that they found a resolution to? Am I missing something incredibly silly and obvious?

-Daniel

more ▼

asked Dec 01 '09 at 10:37 AM

Daniel Cazan gravatar image

Daniel Cazan
74 2 2 4

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Arg, never mind. I have no idea what was wrong and I have been head-butting this for hours now trying to find the line of code I must be doing wrong. Fortunately the year I did tech support finally kicked in so I slapped my forehead, restarted my computer, and now Unity detects the mouse positions correctly. Its always the brute force method that prevails isn't it? Sorry about that.

more ▼

answered Dec 01 '09 at 10:43 AM

Daniel Cazan gravatar image

Daniel Cazan
74 2 2 4

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x954

asked: Dec 01 '09 at 10:37 AM

Seen: 2435 times

Last Updated: Feb 17 '10 at 02:38 PM