Simple Node Based movement System

Every Field is a Node
Additional: Camera dump smooth follow
This commit is contained in:
brausjonas
2023-01-23 22:10:02 +01:00
parent 0142f00f8b
commit 4f0dcefbcb
12 changed files with 1052 additions and 379 deletions
@@ -0,0 +1,23 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Camera : MonoBehaviour
{
//TODO: Replace with Follow Function later (player camera should follow)
[SerializeField] private GameObject followUp;
private Vector3 offset;
private Vector3 velocity = Vector3.zero;
//TODO: Replace with Follow Function later (player camera should follow)
private void Start()
{
offset = followUp.transform.position - transform.position;
}
private void FixedUpdate()
{
transform.position = Vector3.SmoothDamp(transform.position, followUp.transform.position - offset, ref velocity, 0.6f);
}
}