upd
This commit is contained in:
parent
de20b3ba8a
commit
6b3ed6a2f4
@ -9192,7 +9192,7 @@ MeshCollider:
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
@ -9356,6 +9356,14 @@ PrefabInstance:
|
||||
propertyPath: m_Name
|
||||
value: SinglePlayer
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8370227802790125322, guid: 22aace1332feb514b823ccbdd87e8439, type: 3}
|
||||
propertyPath: runSpeed
|
||||
value: 200
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8370227802790125322, guid: 22aace1332feb514b823ccbdd87e8439, type: 3}
|
||||
propertyPath: walkSpeed
|
||||
value: 200
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
@ -10624,7 +10632,7 @@ MeshCollider:
|
||||
m_LayerOverridePriority: 0
|
||||
m_IsTrigger: 0
|
||||
m_ProvidesContacts: 0
|
||||
m_Enabled: 1
|
||||
m_Enabled: 0
|
||||
serializedVersion: 5
|
||||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
|
@ -29,7 +29,7 @@ namespace Player
|
||||
if (Cursor.lockState == CursorLockMode.Locked)
|
||||
{
|
||||
transform.Rotate(Vector3.up * mouseX);
|
||||
_camera.transform.localRotation = Quaternion.Euler(_xRotation, 0f, 0f);
|
||||
_cameraTransform.localRotation = Quaternion.Euler(_xRotation, 0f, 0f);
|
||||
_cameraTransform.rotation = Quaternion.Euler(_xRotation, transform.eulerAngles.y, 0f);
|
||||
_cameraTransform.position = targetCameraPosition.position;
|
||||
}
|
||||
|
@ -1,14 +1,11 @@
|
||||
using Mirror;
|
||||
using Player.States;
|
||||
using StateMachine;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Player
|
||||
{
|
||||
public class Movement : MonoBehaviour
|
||||
{
|
||||
public float walkSpeed = 400f;
|
||||
public float runSpeed = 1200f;
|
||||
public float walkSpeed;
|
||||
public float runSpeed;
|
||||
public float jumpForce = 160f;
|
||||
public float groundCheckRadius = 0.14f;
|
||||
public Transform groundCheck;
|
||||
@ -24,7 +21,8 @@ namespace Player
|
||||
{
|
||||
playerRigidbody = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
|
||||
private Vector3 _velocity;
|
||||
void Update()
|
||||
{
|
||||
isGrounded = Physics.CheckSphere(groundCheck.position, groundCheckRadius, groundLayer);
|
||||
@ -34,14 +32,17 @@ namespace Player
|
||||
playerRigidbody.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
|
||||
}
|
||||
|
||||
Vector3 velocity = moveDirection * (walkSpeed * Time.deltaTime);
|
||||
_velocity = moveDirection * (walkSpeed * Time.fixedDeltaTime);
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
if (Cursor.lockState == CursorLockMode.Locked)
|
||||
{
|
||||
playerRigidbody.velocity = new Vector3(velocity.x, playerRigidbody.velocity.y, velocity.z);
|
||||
playerRigidbody.velocity = new Vector3(_velocity.x, playerRigidbody.velocity.y, _velocity.z);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void OnDrawGizmosSelected()
|
||||
{
|
||||
if (groundCheck != null)
|
||||
|
@ -103,7 +103,7 @@ PlayerSettings:
|
||||
xboxEnableFitness: 0
|
||||
visibleInBackground: 1
|
||||
allowFullscreenSwitch: 1
|
||||
fullscreenMode: 0
|
||||
fullscreenMode: 1
|
||||
xboxSpeechDB: 0
|
||||
xboxEnableHeadOrientation: 0
|
||||
xboxEnableGuest: 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user