Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: ivam on September 26, 2014, 05:23:59 AM
-
heya guys,
ive got the head of my character looking at an object created on collision with raycast from the camera, so the head allways looks where the camera looks at, however naturaly i need to limit the heads rotation to -60 and +60 degrees but iam getting frustrated as i cant find a solution after 3 hours.
id simply like the characters head to go back to 0 Y rotation as soon as it would passes a certain point of rotation so i dont get the 360 spinning head effect.
-
shameful bump
-
Would using a clamp action on the rotation help?
-
Go bump this thread.
http://hutonggames.com/playmakerforum/index.php?topic=8032.msg40387#msg40387
It's for a new lookAt action with limits on each axis. Bumping the thread gives it attention.
-
Would using a clamp action on the rotation help?
probably but iam not sure how to approach this, the only clamp in playmaker is the float clamp i think and iam not sure how to clamp the rotation with a float clamp, especialy since its not as easy as from -60 to +60 degrees, since there aint any negative values for rotation, id have to clamp somehow from 300 to 360 and then from 0 to 60 ?
-
has no one else encountered this issue before ?
i feel like the only solution is to use a custom script rather than playmaker at this stage
-
solved it by comparing the angle of where iam looking at to the rotation of the body, becomes this angle greater than 80 degrees i flick a switch to make the character look forward.
only downside of it is that it makes the head snap back to its original position making it look jerky and unnatural, guess ill find a solution for that sometime soon too.