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
2
Question by OmegaVemon · Nov 22, 2010 at 04:52 AM · lookatcenterorigin

LookAt - Change rotation origin point?

So I have a cannon, and it is basically looking at wherever the Mouse is. So the rotation is constantly changing. But the cannon rotates around its center. And that's unnatural...

So my question is more like... how do I set a "origin point" for the cannon to rotate around it instead of its own center?

Comment
Add comment
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

2 Replies

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

Answer by duck · Nov 22, 2010 at 09:41 AM

The simplest way to solve this would be to parent your cannon model to an empty dummy gameobject, and offset the cannon position so that when you rotate the empty parent model, the cannon model rotates around the desired origin.

Either that, or open the cannon model in your 3D editing application and modify the origin/pivot directly!

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 OmegaVemon · Nov 22, 2010 at 06:13 PM 0
Share

Genius! Thanks!!

avatar image fodgamer · Sep 23, 2012 at 09:38 AM 0
Share

Sorry I just want to check with you, I tried parenting my model to a dummy object but the origin of the parent is an aggregate position of both objects, am I doing something wrong?

avatar image
0

Answer by Proclyon · Nov 22, 2010 at 07:59 AM

The transform is the method in which the Unity3D system and the PhysX engine actually perceive an objects "origin.

To create a rotation means to change the angle over the axis of the transform axes. Say 90 degrees over Y would make a standing character face right (absolute right, not relative right)

So rotating the object around another object by editing the origin point is not a possibility. You would have to set a radius of the circle around you move your cannon. How far from the target point is the cannon?

Once you have that you need to move (rotate around that target) by changing the position of the transform of the cannon. The x component is the cos value of the angle and y the sin value of the angle. Those two with the radius make for the distance and rotation around the object.

Complicated? Yes quite, I would strongly recommend looking if such a feature (Inbuilt method) does not already exist in Unity3D calls internal or to PhysX. That could save you a large amount of time.

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

1 Person is following this question.

avatar image

Related Questions

LookAt - Change rotation origin point? 1 Answer

Reset GameObject Axis Origin at Model Center 1 Answer

Move the terrain to center on origin 0 Answers

Degree from point? 2 Answers

Make object face center of circle without flipping in 2D space. 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