|
Post by archieandrews on Jul 20, 2018 13:58:04 GMT
Hi I would like to be able to hit a key or whatever trigger and when this happens make the 3rd person character turn towards and face the camera.
I guess this is a 2 part process: 1. Turn character towards cam 2. Move head to look at cam
The most important option is 1 - Turn Character facing the cam as I have a script that motions the head look already
TY
|
|
|
Post by Legion on Jul 20, 2018 14:09:44 GMT
Not tested, but what if you make a gameobject children of the camera and use the vHeadTrack and activate or deactivate it when you want to look / not look at it?
|
|
|
Post by archieandrews on Jul 20, 2018 14:44:04 GMT
Nah, headtrack just moves the head. I already have a head control that looks at a crosshair type control which is moved by joystick.
I'm not developing a typical game/shooter its more for creating animation video clips for a special project.
Therefore I want to simply hit a key and he turns to face the cam. (basically rotate with a animation) then goes back to controller state.
I know I can do this via script manually turning the character using raycast or such to find direction of camera .. But just wondered if Invector had anything that did such a function off the shelf to save me from coding one.
|
|
|
Post by archieandrews on Jul 20, 2018 15:27:19 GMT
Managed to turn him with code below, but needs animation adding.
var lookPos = Camera.main.transform.position - TheMouse.transform.position; lookPos.y = 0; var rotation = Quaternion.LookRotation(lookPos); TheMouse.transform.rotation = Quaternion.Slerp(TheMouse.transform.rotation, rotation, Time.deltaTime *10f);
|
|
|
Post by Legion on Jul 20, 2018 15:50:23 GMT
Something like in The Evil Within that makes a 180 ° turn towards the camera and then it is positioned again behind the player? Perhaps the best thing would be to do a new action, like "roll".
|
|
|
Post by archieandrews on Jul 20, 2018 16:08:34 GMT
Cheers, I've sorted the turn code, so yeah I'll look at Generic Action component for the anim.
|
|