- Home /
Question by
Turtle-Racer · Apr 24, 2016 at 07:31 AM ·
shootingplatformermousepositiondiagonal
How can I implement mouse(x,y) on a 2D platformshooter?
I have my x,y coordinates logged on the console; now I want to make an instantiated objectShoot in a Vector3 (mouseX,mouseY );
void Update(){ var v3 = Input.mousePosition; v3.z = 10.0; v3 = Camera.main.ScreenToWorldPoint(v3);
if(Input.GetMouseButtonUp(2)){ Debug.Log (v3); } }
Comment
Your answer
Follow this Question
Related Questions
How to destroy only one GameObject??? 0 Answers
Need explanation for this code 0 Answers
Using MoveToward but is no working. 2 Answers
My shooting system wont work, help 1 Answer
Fire bullet into the direction my player is facing 2D 2 Answers