d platformer arena like game. Right now I have it so a reticle moves around the player based on a controller's right stick's horizontal movement using the rotate around function and while it works great on keyboard on it is funky on controllers since you have to hold it left to rotate counter clockwise and right to make it rotate clockwise. I've been working on changing this for well over a month and a half. I've tried coding it myself and then googling it like crazy but I came up with nothing. the input they give you based on vertical and horizontal is what perplexes me the most. in the debugger comes up like this from a debug.log when tilting it up- "H: 0.02528, V: -.9874454". Which makes sense but when going to the top right it looks like "H: 0.7592, V: -.842965". That's the part that confuses me. I can't find a way to use this data in any of the functions I have experience with and experimenting with new ones has gone nowhere. Any suggestions or ideas would help me greatly and would be even more appreciated!
Based on the above image I want my reticle to be placed in a spot on it's orbit around a player's center based on the right stick's position on the controller. So if I completely titled up my stick the reticle goes up but if I release it stays there. Then if I tilt it to the left bottom corner it will "teleport" there without moving along the orbit. So think of old school twin stick shooters where you can aim instantly in the direction of your choice.
This is my old code that used rotate around that slowly makes the reticle orbit as you hold the stick constantly left or right. I added a new axis called AV which is for vertical instead of just horizontal so now I just need a way to use these together somehow.
void AimControllers()
{
if (currentControllerAimAxisH != null)
{
AH = Input.GetAxis (currentControllerAimAxisH);
if (Mathf.Abs (AH) > stickTol)
{
reticle.transform.RotateAround(this.transform.position,new Vector3(0,0,-AH),orbitAngle);
}
}
}