Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by Blue_and_Company · May 09, 2016 at 03:33 PM · unity 5cameracamera rotatecamera followcamera rotation

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?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image meat5000 ♦ · May 09, 2016 at 11:30 AM 0
Share

I have a great idea... Post your script ;)

avatar image pankajb · May 09, 2016 at 04:45 PM 0
Share

@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.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges