forked from Wireline-Studios/JourneyProject
w
This commit is contained in:
@@ -108,8 +108,17 @@ public class IntroWagon : MonoBehaviour
|
||||
transform.rotation = Quaternion.Euler(currentEuler);
|
||||
|
||||
transform.position += transform.forward * 2.25f * Time.deltaTime;
|
||||
player.transform.position = Vector3.MoveTowards(player.transform.position, playerKeeper.transform.position, Mathf.Infinity * Time.deltaTime);
|
||||
npc.transform.position = Vector3.MoveTowards(npc.transform.position, npcKeeper.transform.position, Mathf.Infinity * Time.deltaTime);
|
||||
if (Time.deltaTime > 0)
|
||||
{
|
||||
player.transform.position = Vector3.MoveTowards(player.transform.position, playerKeeper.transform.position, Mathf.Infinity * Time.deltaTime);
|
||||
npc.transform.position = Vector3.MoveTowards(npc.transform.position, npcKeeper.transform.position, Mathf.Infinity * Time.deltaTime);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
player.transform.position = Vector3.MoveTowards(player.transform.position, playerKeeper.transform.position, Mathf.Infinity);
|
||||
npc.transform.position = Vector3.MoveTowards(npc.transform.position, npcKeeper.transform.position, Mathf.Infinity);
|
||||
}
|
||||
npc.transform.rotation = npcKeeper.transform.rotation;
|
||||
|
||||
player.GetComponent<PlayerMovement>().energy = 0;
|
||||
@@ -120,7 +129,7 @@ public class IntroWagon : MonoBehaviour
|
||||
timer3 += Time.deltaTime;
|
||||
if (timer3 > .8 && timer3 < .9)
|
||||
{
|
||||
npc.GetComponent<MouthOpenClose>().whatToSay = "You had me scared for a moment there!";
|
||||
npc.GetComponent<MouthOpenClose>().whatToSay = "It looks like the city is under attack!";
|
||||
|
||||
npc.gameObject.GetComponent<MouthOpenClose>().interacted = true;
|
||||
npc.gameObject.GetComponent<MouthOpenClose>().prompt.SetActive(false);
|
||||
|
||||
@@ -120,14 +120,13 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
moveInput = walkAction.ReadValue<Vector2>();
|
||||
|
||||
if (runAction.WasPressedThisFrame() && moveAnimationInputY == 1 && !running)
|
||||
if (runAction.WasPressedThisFrame() && !running)
|
||||
{
|
||||
running = true;
|
||||
}
|
||||
else if (runAction.WasPressedThisFrame() && moveAnimationInputY == 2 && running)
|
||||
else if (runAction.WasPressedThisFrame() && running)
|
||||
{
|
||||
running = false;
|
||||
moveAnimationInputY = 1;
|
||||
}
|
||||
|
||||
playerCam.lookInput = lookAction.ReadValue<Vector2>();
|
||||
@@ -285,18 +284,18 @@ public class PlayerMovement : MonoBehaviour
|
||||
|
||||
//Debug.Log(controller.isGrounded);
|
||||
|
||||
if (canWalk /*&& !running*/)
|
||||
if (canWalk && !running)
|
||||
{
|
||||
Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * speed);
|
||||
Vector3 move2 = transform.TransformDirection(move);
|
||||
controller.Move(move2 * Time.deltaTime);
|
||||
}
|
||||
//else if (canWalk && running)
|
||||
//{
|
||||
// Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * runSpeed);
|
||||
// Vector3 move2 = transform.TransformDirection(move);
|
||||
// controller.Move(move2 * Time.deltaTime);
|
||||
//}
|
||||
else if (canWalk && running)
|
||||
{
|
||||
Vector3 move = new Vector3(moveInput.x * speed, 0, moveInput.y * runSpeed);
|
||||
Vector3 move2 = transform.TransformDirection(move);
|
||||
controller.Move(move2 * Time.deltaTime);
|
||||
}
|
||||
controller.Move(velocity * Time.deltaTime);
|
||||
}
|
||||
private void MyInput()
|
||||
|
||||
Reference in New Issue
Block a user