Add boundaries to world map
This commit is contained in:
@@ -1075,9 +1075,9 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: e12a799f5a50bc34a94898baf2917b7b, type: 3}
|
m_Script: {fileID: 11500000, guid: e12a799f5a50bc34a94898baf2917b7b, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
rayCastDistance: 4
|
rayCastDistance: 10
|
||||||
rayCastAngle: 60
|
rayCastAngle: 60
|
||||||
sphereRadius: 1
|
sphereRadius: 5
|
||||||
--- !u!114 &7831886137308850989
|
--- !u!114 &7831886137308850989
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using UnityEngine;
|
using Scampz.GameJam.Assets.Scripts.Player;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
namespace Scampz.GameJam.Assets.Scripts
|
namespace Scampz.GameJam.Assets.Scripts
|
||||||
{
|
{
|
||||||
@@ -8,10 +9,12 @@ namespace Scampz.GameJam.Assets.Scripts
|
|||||||
public float Speed = 10f;
|
public float Speed = 10f;
|
||||||
public float RotateSpeed = 720.0f;
|
public float RotateSpeed = 720.0f;
|
||||||
private float _ySpeed = 0f;
|
private float _ySpeed = 0f;
|
||||||
|
private PlayerState _playerState;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
_controller = GetComponent<CharacterController>();
|
_controller = GetComponent<CharacterController>();
|
||||||
|
_playerState = GetComponent<PlayerState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update()
|
void Update()
|
||||||
@@ -36,7 +39,8 @@ namespace Scampz.GameJam.Assets.Scripts
|
|||||||
velocity = AdjustVelocityToSlope(velocity);
|
velocity = AdjustVelocityToSlope(velocity);
|
||||||
velocity.y += _ySpeed;
|
velocity.y += _ySpeed;
|
||||||
|
|
||||||
_controller.Move(velocity * Time.deltaTime);
|
if (_playerState.CanMove)
|
||||||
|
_controller.Move(velocity * Time.deltaTime);
|
||||||
|
|
||||||
if (movementDirection != Vector3.zero)
|
if (movementDirection != Vector3.zero)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user