Search Unity

Dragging to aim and shoot?

Discussion in 'Scripting' started by ltrout1999, Feb 12, 2016.

  1. ltrout1999

    ltrout1999

    Joined:
    Oct 11, 2015
    Posts:
    125
    In the game Soccer Stars or even in Angry Birds, you drag an object a certain distance and let go to shoot that object. How would I go about doing this? Also, how would I go about having a slider that points the opposite of where you're dragging? Basically what I mean is, if you drag on the disc backwards (to make it shoot forwards) how would I make the slider show that way, but if the user adjusts slightly, than the slider will turn with it? Like in angry birds the arrow follows the trajectory at which the bird will fly? I just need a straight arrow as the game is 2D and the discs will only be moving along the plane.
     
  2. Josenifftodd

    Josenifftodd

    Joined:
    Nov 29, 2013
    Posts:
    158
    You could maybe make it so whatever is being instantiated, once it does the cam targets the object and if the cam is targeting an image appears above the object and then it should follow it with the cursor above it.

    It'd be helpful to see what code you have done for people to suggest better ways. :p