Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by james 4 · Dec 21, 2010 at 02:27 AM · camerasphereparenting

parenting a camera with a sphere

i paired a camera with a sphere so the camera would follow the sphere, but when i play it the camera rotates with the sphere. how do i make it just follow?

Comment
Add comment · Show 3
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 Jesus_Freak · Dec 21, 2010 at 03:27 AM 1
Share

you could make them separate objects again, add a SmoothFollow camera control script, or make your own script to say in the Update function: transform.position = Vector3(PlayerObject.position.x,PlayerObject.position.y,(PlayerObject.position.z + 5)) don't forget to make a var PlayerObject : Transform; and then attach that javascript to your camera.

avatar image burnumd · Dec 21, 2010 at 09:31 PM 0
Share

Why don't you list that as an answer?

avatar image Jesus_Freak · Dec 22, 2010 at 06:23 PM 0
Share

i guess i was just in a hurry... and didn't recognize that what i gave was an actual answer. regarless, it's an answer now!

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by SarperS · Dec 22, 2010 at 08:23 PM

Create a new Javascript, add it to the camera, set it's target as your sphere and tweak the offset coordinates to determine the offset.

> var target : Transform; var offset :
> Vector3;
> 
> function LateUpdate(){
>     transform.position = target.position + offset; }
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
avatar image
0

Answer by dissidently · Dec 21, 2010 at 07:38 PM

Connect the camera to the sphere with a Configurable.Joint and make sure it's X,Y and Z rotation is set to FREE. If you're using physics, which you probably are with a sphere, the camera might affect your physics a little... if so, create an empty game object and attach that to the sphere with the joint and free rotation, then nest the camera to the empty object.

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
avatar image
0

Answer by Jesus_Freak · Dec 22, 2010 at 06:19 PM

you could make them separate objects again, add a SmoothFollow camera control script, or make your own script to say in the Update function:

transform.position = Vector3(PlayerObject.position.x,PlayerObjcect.position.y,(PlayerObject.position.z + 5))

don't forget to make a var PlayerObject : Transform; and then attach that javascript to your 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

No one has followed this question yet.

Related Questions

A node in a childnode? 1 Answer

Orthographic camera scale Problems? 0 Answers

Let camera render the scene just one time 1 Answer

how can i moving from camera to other using a code? 1 Answer

How do I parent a new camera to my main camera? 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