using LanLib.UpdateManager; using UnityEngine; namespace Samples.UpdateManager { public class TestFollowTarget : AManagedBehaviour, IUpdatable { [SerializeField] private Camera camera; private void Awake() { if (!camera) { camera = Camera.main; } } public void ManagedUpdate() { if (!Input.GetMouseButton(0)) { return; } var ray = camera.ScreenPointToRay(Input.mousePosition); var xz = new Plane(transform.up * 10, transform.position); if (xz.Raycast(ray, out float z)) { transform.position = ray.GetPoint(z); } } } }