Removed 3D player model, reworked camera rotation (When going diagonal it is still possible to flip around, but thats fine I guess)

This commit is contained in:
Finnchen123
2025-06-07 12:45:15 +02:00
parent dd1b3db417
commit eded2be2ef
6 changed files with 432 additions and 3052 deletions

View File

@@ -22,7 +22,7 @@ namespace Assets.Scripts.Player
// Update is called once per frame
void Update()
{
}
private void FixedUpdate()
@@ -43,16 +43,17 @@ namespace Assets.Scripts.Player
return null;
}
public void LookUpAndDown(Vector2 view, Vector2 speed)
public void LookAround(Vector2 view, Vector2 speed)
{
GameObject target = GameObject.Find("targetLooking");
target.transform.localPosition = target.transform.localPosition + new Vector3(0,view.y,0) * speed.y;// * Time.deltaTime;
if(target.transform.localPosition.y >= 2){
target.transform.localPosition = new Vector3(target.transform.localPosition.x,2f,target.transform.localPosition.z);
if (transform.rotation.x <= -0.25)
{
if (view.y > 0) return;
}
if(target.transform.localPosition.y <= -1){
target.transform.localPosition = new Vector3(target.transform.localPosition.x,-1f,target.transform.localPosition.z);
if (transform.rotation.x >= 0.25)
{
if (view.y < 0) return;
}
transform.Rotate(Vector3.left, view.y * speed.y);
}
void showInformation()