Search Unity

3rd person crosshair

Discussion in 'Scripting' started by blueinfinety, Aug 30, 2011.

  1. blueinfinety

    blueinfinety

    Joined:
    Aug 30, 2011
    Posts:
    5
    Hi,

    I am making a 3rd person tank game.
    And i have the question how can i make a crosshair, that is pointing at te location a want to schoot at. And how i hide my mouse pointer?


    thx
     
  2. blueinfinety

    blueinfinety

    Joined:
    Aug 30, 2011
    Posts:
    5
    I am realy a beginner, so please give me a tip
     
  3. Kinos141

    Kinos141

    Joined:
    Jun 22, 2011
    Posts:
    969
    You need to look at Raycast, study that up. You would have to raycast from the position of the screen, directly in the middle. There are some tutorials on how to make a third person shooter and an fps, the idea is the same.
    to hide a mouse, use lockCursor function.
    for crosshairs, use a texture.
     
    Last edited: Aug 30, 2011
  4. blueinfinety

    blueinfinety

    Joined:
    Aug 30, 2011
    Posts:
    5
    ok, thx for the reply
     
  5. Eiznek

    Eiznek

    Joined:
    Jun 9, 2011
    Posts:
    374
    Honestly if your just looking to make some recticles( crosshairs ) you simply can make a GUITexture add your graphic to it. Then apply them to the center for the screen.. Then just enable = false your mouse cursor.

    If your tank had some kind of offset you'd have to account for that. Maybe making an invisible Game Object that follows the mouse movement and that could be where your GUITexture is placed. -- Check out the 3rd Person Shooter they use this technique.

    Many solutions. But like everyone else here you need to learn how to do it yourself. Finding solutions is what makes you a programmer. Help is definately nice from time to time however.

    Anyhow good luck.