fix: Update show elesplayer,
This commit is contained in:
@@ -93,32 +93,32 @@ public class CharacterCtrl : MonoBehaviour
|
||||
playerVelocity.y = 0f;
|
||||
}
|
||||
|
||||
float x = joystick.Horizontal;
|
||||
float z = joystick.Vertical;
|
||||
//float x = joystick.Horizontal;
|
||||
//float z = joystick.Vertical;
|
||||
|
||||
Vector3 move = new Vector3(x, 0, z);
|
||||
move = Vector3.ClampMagnitude(move, 1f);
|
||||
//Vector3 move = new Vector3(x, 0, z);
|
||||
//move = Vector3.ClampMagnitude(move, 1f);
|
||||
|
||||
if (move != Vector3.zero)
|
||||
{
|
||||
transform.forward = move;
|
||||
if (isRun)
|
||||
{
|
||||
SetAnimRun();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAnimWalk();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAnimIdle();
|
||||
}
|
||||
//if (move != Vector3.zero)
|
||||
//{
|
||||
// transform.forward = move;
|
||||
// if (isRun)
|
||||
// {
|
||||
// SetAnimRun();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// SetAnimWalk();
|
||||
// }
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// SetAnimIdle();
|
||||
//}
|
||||
|
||||
playerVelocity.y += gravityValue * Time.deltaTime;
|
||||
Vector3 finalMove = (move * playerSpeed) + (playerVelocity.y * Vector3.up);
|
||||
controller.Move(finalMove * Time.deltaTime);
|
||||
//playerVelocity.y += gravityValue * Time.deltaTime;
|
||||
//Vector3 finalMove = (move * playerSpeed) + (playerVelocity.y * Vector3.up);
|
||||
//controller.Move(finalMove * Time.deltaTime);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user