So I'm attempting to make a camera at a fixed angle with no rotation,I'm trying to set my camera on a follow path while keeping a fixed angle.
Like the topic says I'm trying to make a third-person camera with no rotation at a fixed distance from the player. The player will be on a 3D plane and will play like a side-scroller that has doors/paths to lead to new areas. The issue is that no matter what I try either it doesn't work or just comes up with an error message. When trying to use a parent/child relationship it rotates with the player. When trying to have it follow an invisible object that is in a parent/child relationship with the player it still rotates with the player, despite me having frozen the rotation on it. When I checked the forums I saw some other people asking similar questions and them scripts to try that worked for them, but it all just throws back a dozen error messages that range from "unexpected token: float" to "Insert a semicolon at the end" when there already is one. I'm fairly new to Unity and even newer to coding in Csharp and Java, so I'm learning as I go and want to work on this project for a while. Anyone have ideas? ,So like the title says, I'm attempting to have a third-person camera stay at a fixed angle with no rotation and no change in distance unless I want to script it for unique situations. The issue I'm running into is that the making a parent-child relationship makes it rotate however it wishes. I've tried having it follow another invisible object that's parent was my player and even that allowed rotation. I'm stuck and when reading through the forums and all the code people suggest it shoots me back error messages by the boatload. I'm new to using Unity and coding as well and while I can read some of this it is still above my pay-grade. Anyone have any ideas?
@Blue_and_Company How about saving camera angles somewhere and re assign it to camera transform in update method if there is change in camera angles.
Answer by tanoshimi · May 09, 2016 at 04:53 PM
void Update () {
Camera.main.transform.position = Player.position - Vector3.forward * 3.0f);
}
Will keep the player 3 units behind the player in world space, and not rotate.
Your answer
Follow this Question
Related Questions
Fixed Camera rotate to follow player 2 Answers
How to rotate a camera around a spaceship freely 0 Answers
Third person controller camera 1 Answer
Making camera follow the player the right way 0 Answers
Tilting a camera around an object 0 Answers