al3d
New vMember
Posts: 2
|
Post by al3d on Aug 14, 2016 15:21:31 GMT
Hi ^^ ( sorry if my english is not perfect I'm french ) I bought the basic locomotion and melee combat template they're amazing but there're something I really need to have for my game it's a camera rotation angle limit. I need the same thing that is in the VHeadTrack script ( angle range x & y ) but for the fixed point "resident evil" camera of the VMansion. What code I should add in the cam script to get that ? please help me thx
|
|
|
Post by Invector on Aug 16, 2016 17:52:45 GMT
Hmmm well this is not a easy thing to do, but I think that is possible and here is a theory:
on the method CameraFixed () in v3rdPersonCamera script, it contains the recorded rotation of the camera point, (currentState.lookPoints[indexLookPoint].eulerAngle). You can use this rotation combined with the look target rotation( Quaternion.LookRotation(targetPos - transform.position);) to create a limit using individual axes.
Example:
var euler = currentState.lookPoints[indexLookPoint].eulerAngle; var targetEuler = Quaternion.LookRotation(targetPos - transform.position).eulerAngles; targetEuler.y = Mathf.Clamp(targetEuler.y, euler.y - 90, euler.y + 90);
|
|
al3d
New vMember
Posts: 2
|
Post by al3d on Aug 16, 2016 18:57:47 GMT
Thanks for the answer I'll try that, you should add it in the next update there're that kind of camera in Resident evil 1 HD remaster ^^
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Dec 4, 2016 13:04:42 GMT
Nice! That would be interesting with a limit, did it work?
|
|