This is still a huge cause of frustration for me, unity's solution for look rotations is 'Do the maths yourself jerk, but hey we made a crap trail renderer - enjoy'.
"Mathf.Atan2(targetPos.x - transform.position.x, targetPos.y - transform.position.y)* (180 / Mathf.PI) ;"
"Return.z = Return.z > 180 ? Return.z - 360 : Return.z;"
Screw ALL of that, unity has been punching me in the balls with this jibberish to the point where its making me want to quit for an engine that has actual
scripting commands for making games.
http://constraints.path-o-logical.com/Path-o-logicals Unity Constrains Smooth look At completely nails look rotations - when it works, damn thing takes an age to start up plus now & again it just does not start for me...joy.
Inspired by jean inserting my broken script into a custom action I've started making my first custom action for Unity Constrains Smooth look At. I got the target assigning done which is the important bit (you'll probably set the rest of the stuff in editor) but seeing as I use java & resources for custom actions in java are non existent this is as far as I can get for now.
Works pretty good right? ...Nope I can't clamp it
The blue arrow has the extracted rotation from its neighbour clamped (yay) but I'm unable clamp the object with the constraint itself. I would have thought playmakers rotate action would do the job but maybe Constraints wants me to clamp the target vector - in which case I'm back at square one with the maths bullcrap.
To summarise:
1. How can I clamp This thing?
2. Need the java syntax info for making custom actions
3. I would buy playmaker again for a smooth look at action that
just works no matter what.