- Home /
Move between two objects based on distance
Here's a question for a camera system for my game. I have two game objects (Point A and Point B) that I want my camera to travel along using a CamPos game object. Upon entering a trigger, the camera snaps to PointA. I can calculate the distance between Point A & B and get my CamPos game object to look at PointB.
What I would like to do is feed my CamPos a float amount and "push" my CamPos to point A or B based on that float amount. Currently, I tried transform.lerp(PointA, PointB, time.deltatime) but it's only based on time to travel between PointA and B. Is there a way to turn time.deltatime into a float or some other function similar to that?
Comment