Reputation: 9
I made a first-person game, I just finished the code that makes the character move but when he moves,
the camera stays in the same place instead of moving with it.
Does someone know what's my problem?
Upvotes: 0
Views: 2379
Reputation: 3842
In addition to @Caner Gorez's simple answer, There's unity package called cinemachine that gives you really cool control over how the camera follows the player. There's a bunch of tutorials on YouTube of how to set it up, but it's definitely a bit more complicated than just parent-child relationships
Upvotes: 5
Reputation: 31
you should use parent child relations. Just drag the camera on a moving object(this is your player) in the hierarchy panel or you can write a follow script for camera then add it to your camera that makes camera move with player. The second way is better but you can use both of them.
Upvotes: 3