Worms/Scorched Earth/Gunbound - Angle Selection (For my game "UbberStory")

:face_with_spiral_eyes::face_with_spiral_eyes::face_with_spiral_eyes:
So my game is going to be just like the aforementioned games in the title.
In all of these games, they have an angle that you can select.
The angle will then be used to shoot projectiles in the selected angle direction.
I need some advice or a point in the right direction to acquire the same effect.


So basically, 90 degrees would be straight up, if you change your angle to the right or left it would go down from 90. ex. 89 ,88, 87 etc.

I will have some text next to the needle displaying what angle is currently selected.
Also, i would need it to do the following:
For ex. You are going UP a slope. You are facing right with an angle of 75 degrees, when you turn left and head DOWN the slope the angle is obviously not going to be the same because the “needle” is now facing lower because of the slope.
I need it to know what angle that is when it turns around. So when facing right: 75 degrees and when facing left it knows that the angle is now 24 degrees (or whatever it would be).

Sorry if that was confusing, I have compiled a test for you guys to show you what i am talking about. (Angle wise)
http://www.incursiogames.com/test/
Controls:
up/down arrows - change angle
left/right arrows - move

And my code for the needle:

#pragma strict

var TopAngle: float = 0; // Max needle angle
var BottomAngle: float = 0; // Min needle angle

function Start () {

}

function Update () {

// Needle movement
if(Input.GetKey(KeyCode.UpArrow)) {
	transform.localEulerAngles.z -= 1;
}

if(Input.GetKey(KeyCode.DownArrow)) {
	transform.localEulerAngles.z += 1;
}
// End needle movement code
 
 
// Keep needle from moving past avaliable angles	
if(transform.localEulerAngles.z >= BottomAngle  transform.localEulerAngles.z < TopAngle){  
	if(transform.localEulerAngles.z < 180){  
    	transform.localEulerAngles.z = (BottomAngle - .1);  
    } else{  
        transform.localEulerAngles.z = (TopAngle + .1);  
    }  
 }
// End needle lock code

} // End update

wouldn’t that just be the “eulerAngles” property of the transform, i.e. the orientation in world space as opposed to the local space you are working with in the code above?

Ill give it a try, thanks! Sorry, i am pretty new to unity and didn’t know the difference between local and world. Ill look into the documentation a bit more (: