Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 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 kamon_241 · Jan 29, 2016 at 11:58 AM · c#unity 5cameraposition

Resetting Camera Position

Here's the situation; when the player either dies or finishes the level the level will be reset (a bit harder if the player finished the level), which means the the camera needs to be reset to the starting position, which for reasons is 0, 3.95, -10 . Here's all the different ways I have tried to do this:

(within the CameraController class)

 transform.position = new Vector3(0f, 3.95f, -10f);

nope,

 Vector3 defaultPos = new Vector3(0,3.95f,-10f);
 transform.position = defaultPos;

nope,

 Vector3 defaultPos = new Vector3(0,3.95f,-10f);
  transform.position = new Vector3(defaultPos.x, defaultPos.y, -10f);

(within the GameController class)

 Camera mainCam;
 mainCam = Camera.main;
 mainCam.transform.position = new Vector3(0,3.95f,-10f);

nope

 CameraController.Instance.transform.position = new Vector3(0,3.95f,-10f);

still nope

I'm honestly at the end of my rag here. I've been doing this fora bout 6 months now and I really thought I had gotten transforms and Vectors pretty well understood, but clearly not.

Any help will be greatly appreciated, Cheers

Comment
Add comment · Show 1
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 Trigary · Jan 29, 2016 at 03:35 PM 0
Share

When you try to do it does it give you an error or what happens?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by ata_2 · Jan 31, 2016 at 02:46 PM

test this this.gameobject.transform.position = new Vector3(0f, 3.95f, -10f); but make sure this code attached to camera

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

Camera isn't move position? Why my camera isn't change position? 0 Answers

uNet hitboxes and movement. 0 Answers

Problem of stuttering FPS Camera 1 Answer

How To Make The Camera turn around the player using the mouse only separatly from character movement? 0 Answers

Rotation around player. and Camera position, 2 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