Hallo sstrong,
In the ThirdPersonCharacterScript I changed the next line
void ApplyExtraTurnRotation()
{
// help the character turn faster (this is in addition to root rotation in the animation)
float turnSpeed = Mathf.Lerp(m_StationaryTurnSpeed, m_MovingTurnSpeed, m_ForwardAmount);
////////////////here/////////////////////
transform.Rotate(0, m_TurnAmount * turnSpeed * Time.deltaTime, 0);
}
into
void ApplyExtraTurnRotation()
{
// help the character turn faster (this is in addition to root rotation in the animation)
float turnSpeed = Mathf.Lerp(m_StationaryTurnSpeed, m_MovingTurnSpeed, m_ForwardAmount);
////////////////here/////////////////////
transform.Rotate(0, m_TurnAmount * turnSpeed * Time.deltaTime/4, 0);
}
In the input manager I made another input like this:
Name Horizontal
Gravity 3
Dead 1
Sensitivity 1
Type Mouse Movement
next to the input witch already excists like this:
Name Horizontal
Negative Button left
Positive Button right
Gravity 3
Dead 1
Sensitivity 1
Type Key or Mouse Button
All above works just fine.
But know I need to create a code in the ThirdPersonCharacterScript that makes the camera look up and down instead or next to the horizontal movement, so I tried the next code but that doesn’t work :
void ApplyExtraTurnRotation()
{
// help the character turn faster (this is in addition to root rotation in the animation)
float turnSpeed = Mathf.Lerp(m_StationaryTurnSpeed, m_MovingTurnSpeed, m_ForwardAmount);
////////////////here/////////////////////
transform.Rotate( m_TurnAmount * turnSpeed * Time.deltaTime/4, 0,0);
}
The mouse does look up and down, altho the TPC does turn and the camera rotate with it, but the keyboard left and right also is going to look up and down instead of horizontal.
How can I make it work or where to change it to make it work like:
left arrow key horizontal to the left
right arrow key horizontal to the right
forward arrow key move forward
back arrow key move backward
mouse forward turning up (TPC turns back)
mouse backward turning down (TPC turns forward)
mouse to the left move to the left
mouse to the right move to the right
Please note:
I’ve got a TPC where I deleted Ethan, this because of using attached objects with box colliders.
A lot of info this way, hope you’ll understand my problem.