I want to know a simple way to make my camera follow a specific object, using as little script as possible.
is there anything that would work similarly to “Cube.Vector3coordinates = Camera.Vector3coordinates”
2 Answers
2If you start with:
this.transform.position = objectToFollow.position;
the camera will be on the same position as the player, so you will need to offset it using:
this.transform.position = objectToFollow.position - (objectToFollow.forward * offset);
this will offset the camera behind the player, if the player rotates the camera rotates with him.
This would be a basic follow script that you can extend with some smoothing and control for height and others stuff.
import free asset names Utility (i think) which have script that you need
– callmeIs your camera already child to a player?
– Rickywild