Search Unity

3D Curved Arrow

Discussion in 'General Graphics' started by zombee81, Sep 28, 2015.

  1. zombee81

    zombee81

    Joined:
    May 15, 2013
    Posts:
    11
    Hi

    Would anyone know how I would create a curved arrow? I am creating a tennis game, when the player clicks on a place where he wants the ball to land, the arrow appears showing the flight path of the ball.

    I hope you understand what I'm getting at? It's probably not a great explanation, but I'd appreciated any help.

    Many Thanks
     
  2. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Zombee81

    There are different way of approaching this, an efficient one is particle trail and billboards.

    Thus an option would be to create an arrow as a combo of :
    A billboarded sprite for the arrow tip:
    CameraFacingBillboard script from the community
    SpriteRenderer doc

    And a trail renderer for the tail:
    TrailRenderer

    Regarding the shape of the arrow you can go with this excellent tutorial from Catlike coding:
    Curve and spline tutorial

    Finally i have assembled these into an example project (Unity 5.2.1f1) that you can find attached, its itself based on the 2nd example project of the curve & spline tutorial from Catlike coding.

    Screenshot (see attached ArrowExampleProject.unitypackage for full source)
    ArrowExample.png
    Have a great day.

    Florent
     

    Attached Files:

    WestonWei, zombee81 and theANMATOR2b like this.
  3. zombee81

    zombee81

    Joined:
    May 15, 2013
    Posts:
    11
    Oh fantastic, thanks fguinier, that works brilliantly.
     
    fguinier likes this.