How do I make a camera follow something
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"
import free asset names Utility (i think) which have script that you need
Answer by Filhanteraren · Nov 29, 2016 at 07:30 PM
If 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.
Your answer
Follow this Question
Related Questions
plsss do help to select a spawnpoint from 3spawnpoints 1 Answer
Gameobjects transform position minus range 1 Answer
What did i do wrong? ":" is wrong expression?,What did I do wrong? ":" is wrong expression 2 Answers
Find distance from camera perpendicularly to targets transform.right. 1 Answer
How can I create vector fields for use with the new VFX Graph? 3 Answers