started working inventory system

This commit is contained in:
unknown
2025-10-06 15:32:09 +01:00
parent 4d2c0a595d
commit 1ee08ea649
564 changed files with 129649 additions and 355 deletions

View File

@@ -21,9 +21,16 @@ public class CharacterController : MonoBehaviour
{
if (moveTarget != null && Time.time - lastMoveToUpdate > moveToUpdateRate)
{
animator.ResetTrigger("attack");
lastMoveToUpdate = Time.time;
MoveToPosition(moveTarget.position);
}
if (animator != null)
{
float speed = agent.velocity.magnitude;
float normalisedSpeed = speed / agent.speed;
animator.SetFloat("moveSpeed", normalisedSpeed);
}
}
public void LookTowards (Vector3 direction)
@@ -33,7 +40,6 @@ public class CharacterController : MonoBehaviour
public void MoveToTarget (Transform target)
{
animator.SetBool("isMoving", true);
moveTarget = target;
}
@@ -47,6 +53,5 @@ public class CharacterController : MonoBehaviour
{
agent.isStopped = true;
moveTarget = null;
animator.SetBool("isMoving", false);
}
}