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
1
Question by thenachotech1113 · Feb 04, 2014 at 08:26 PM · floating pointturn basedcentered

in game pivot point not be the center of the object

hello everyone, i am trying to make a game where you can, in a minecraft style, build vehicles, weapons, bases, etc. i got down the entire ship building, now i need it to make it usefull. the game will use engine blocks and gyroscope blocks to handle the thrusting and the turning. so my problem is how do i make the entire ship rotate using the gyroscope block as a pivot point. i do not want to deal with playing with parenting. i don't have any idea on how to do this. if some one knows of a way pls tell me.

p.s. dont write code. i want to have this as a learning expeerience, and i dont want you to take to much truble, so pls just ideas and snippets.

kind regards, thenachotech

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 thenachotech1113 · Feb 04, 2014 at 08:29 PM 0
Share

btw the blocks are parented on an empty game object when placed. so there will be a lot of objects in a single vehicle that will have to turn.

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Dblfstr · Feb 04, 2014 at 09:44 PM

I think you might want to look into Transform.RotateAround

You can rotate the ship in any direction around a point you choose, that point would be where your gyroBlock is. Then you choose the angle of rotation.

Transform.RotateAround(rotate on the y axis, of the gyroBlock, 90 degrees);

Transform.RotateAround

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
1

Answer by OtsegoDoom · Feb 04, 2014 at 09:18 PM

I'm not sure why you want to avoid parenting anything since that really would be the easiest way to accomplish what you're after.

I can sort of understand why you wouldn't want to parent anything to the gyro block if it is treated like the rest of your blocks, but how bout this:

  • Gyro block gets placed

  • Gyro block creates empty game object (we'll call this the GyroParent) with the exact same position and rotation as itself

  • Parent your empty game object (the one with all the blocks as children) to your new GyroParent

Either that or just use the transform of your gyro block for all rotation code.

Comment
Add comment · Show 2 · 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 thenachotech1113 · Feb 05, 2014 at 01:05 AM 0
Share

thank you for your answer.the reason i do not want to use parents is because i have a lot of parenting and un-parenting stuff to achieve other mechanics, the more i add the more complex and likely to fail. i realy thank you for your time and this answer has been truely usefull.

avatar image Ouija · Feb 05, 2014 at 01:43 AM 0
Share

There is a lil box on the left side of the screen that says "Centre" change it to "Pivot" I was dealing with door pivots last night, this small feature saved a lot of time

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

21 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

Related Questions

Controlling the curvature of a Bézier curve 2 Answers

The floating point origin and AI 1 Answer

How to make real time turn based game using "Shephertz" SDK? 0 Answers

Quaternion.Angle is inaccurate 1 Answer

Is it possible to have a GUI in world space? 1 Answer


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