Search Unity

Shooting in 2D at mouse position, please help!!!

Discussion in '2D' started by HoangPh, May 2, 2014.

  1. HoangPh

    HoangPh

    Joined:
    Apr 25, 2014
    Posts:
    18
    Hi community,
    I'm new here, im working on somekind of 2d zombie defense, i 've script the player to shoot at mouse cusor, its work, but, my bullet is an arrow, i use transform.Lookat and the bullet some kind of facing to the mouse position on maincamera x,y axis, i know its some kind of weird :cry::cry::cry:, here is the picture to explan:
    $Explain#1.jpg
    $Explain#2.jpg
    thanks for all the help :smile::smile:
    P/S: all i want is to make the arrow look exactly at my mouse cusor, on the player x,y axis, thanks alot.
     
    Last edited: May 2, 2014
  2. cbothra

    cbothra

    Joined:
    Mar 14, 2014
    Posts:
    125
    I think you need to check RotateAround() method.
     
  3. HoangPh

    HoangPh

    Joined:
    Apr 25, 2014
    Posts:
    18
    thanks alot, im gonna test it. Cant you go more detail? =P i dont get it
     
    Last edited: May 2, 2014