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 Vice_Versa · Jun 24, 2015 at 04:01 PM · rotationinstantiatebuttonseuler

How to intantiate an object in front of a rotating object

So im trying to set up an interface where there are a bunch of buttons orbiting around the player, if the player selects one, they will all stop orbiting and more buttons will appear in front of that first button. The problem im having is since the first buttons are all orbiting around the player, i cant actually type in number positions since they are moving (and at one part of the room what would be the x axis is the z axis), which is why the code below is not working. does anybody know how i should be going about this?

 Vector3 selectLocation = new Vector3 (transform.position.x - .3f, transform.position.y -           .625f, transform.position.z - 2f);
         Vector3 orbitLocation = new Vector3 (transform.position.x + .3f, transform.position.y - .625f, transform.position.z - 2f);
 
         Instantiate (selectButton, selectLocation, transform.rotation);
         Instantiate (orbitButton, orbitLocation, transform.rotation);
 
         selectButton.rotation = Quaternion.Euler (90, 0, 0);
         orbitButton.rotation = Quaternion.Euler (90, 0, 0);
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 Scribe · Jun 25, 2015 at 10:41 AM 0
Share

How are you currently rotating the buttons?

avatar image Vice_Versa · Jun 26, 2015 at 04:37 AM 0
Share

i am using transform.RotateAround with my camera set as the target object

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by spooneystone · Jun 25, 2015 at 10:15 AM

Sounds like you could have the buttons that appear in front of the first button as a child of the first button and then set its position locally from its parent. Does that make sense?

Comment
Add comment · Show 1 · 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 Vice_Versa · Jun 25, 2015 at 10:43 PM 0
Share

Yes thats what im trying to do and having trouble with

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

23 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trouble Spawning Bullets with proper rotation 0 Answers

Why is my projectile firing "off" after rotation 1 Answer

Camera Script Rolling on the Z 3 Answers

How do I rotate a quaternion with euler angles? 0 Answers

how do i Limit camera rotation on Y-Axis? 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