- Home /
camera.ScreenToWorldPoint acting strangely
if(Input.GetButtonDown("Fire1")){
	var p : Vector3 = camera.ScreenToWorldPoint (Vector3 (Input.mousePosition.x,Input.mousePosition.y,camera.nearClipPlane));
		points.Push(p);
		print (points);
		
	}
This code is creating points to about 200 pixels right of where they should be. Where is my code going wrong?
Comment
Answer by PAEvenson · Sep 11, 2012 at 07:47 PM
If youre using GUI text you need to set your anchor to middle center. It defaults to middle left I believe.
http://docs.unity3d.com/Documentation/ScriptReference/GUIText-anchor.html?from=TextAnchor
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Isometric camera 2d or 3d 2 Answers
Weapon Camera FOV 1 Answer
How to use vuforia AR Camera for Zoom 1 Answer
Orthographic Camera 2 Answers