vectorToAngle issues

jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
edited November -1 in Working with GS (Mac)
Is it possible to get an angle between two points, but relative to the actor not the scene? I've got a little guy, and i want him to be able to shoot upwards, but only 15 degrees from the top on each side.

the gameplay will be, touch to shoot to that position, if the angle between the guy and the destination is in the allowable area, shoot, otherwise do nothing.

if the guy is standing flat on the ground, this is easy, I can get the vector to angle of his position and the x position, and if that value is between 75 and 105, shoot. But my guy won't always be straight on the ground, he's rotating around a circle, so his base angle needs to adjust.

I tried using the rotation value to keep it calibrated, but that value keeps increasing the more the player rotates around the circle.

any ideas?

Comments

Sign In or Register to comment.