Question by
Sinx_ · Sep 11, 2020 at 06:20 PM ·
vector3mousepositionscreentoworldpoint0
why is my mouse posision allways 0?
Comment
Answer by ransomink · Sep 12, 2020 at 01:11 PM
You are declaring a local MousePos
variable in your Update method; this value is being used in your Instantiate method because both are in the same scope. Your class variable MousePos
is not being used at all. Remove the Vector3
declaration from MousePos
in Update: MousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);