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
11
Question by alexanderameye · Jun 25, 2016 at 05:22 PM · gameobjectrotatepivotorigin

Change pivot point of gameobject

Is there a way to simply change the pivot point of a gameobject and make it rotate around a different axis than the middle axis? thanks!

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

5 Replies

· Add your reply
  • Sort: 
avatar image
21

Answer by Hartnett · Apr 26, 2018 at 03:16 PM

Just wanted to update this with a simple solution that now exists since I was looking for the information as well and I just kept coming across the parent object work around.

  • Probuilder, which is a unity asset right off the asset store, that I believe they said was going to become standard in the future, has the ability to set the pivot point of an object in editor.

  • When you have an object selected clicking on "Freeze Transform" will set the pivot point of the object to 0,0,0 in world space while keeping the other transform information of your mesh exactly where it is in world space. So just take the object that you want to correct the pivot of to near 0,0,0, align it how you want and then click Freeze Transform. Very Handy, and officially supported by unity.

  • There is also a button to set the pivot to the meshes center of mass if you just want to do that quickly.

  • An added benefit of downloading probuilder is that you can edit meshes in unity as well, which is obviously great.

Comment
Add comment · Show 4 · 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 soorajkbabu · Jun 06, 2018 at 06:06 AM 0
Share

But, does ProBuilder allow us to change the pivot of an existing gameobject? If I have a cube, ProBuilder doesn't allow us to change it's pivot to any corner of the cube.

avatar image Hartnett soorajkbabu · Jun 06, 2018 at 03:18 PM 1
Share

I just checked to make sure of this, but you can indeed change the pivot point of an existing object using probuilder as of unity version 2018.1.2f1 and probuilder package 3.0.8.

  • Select the object that you want to set the pivot of

  • Click "Probuilderize" in the probuilder window

  • $$anonymous$$ove the point on the object that you want to be the new pivot to world space 0,0,0 (Note: you can also rotate the object at this point if you want to change that as well)

  • Click Freeze Transform in probuilder

  • At this point the pivot is set to the new location and rotation based on 0,0,0 world space. If you want you can now go Tools>Probuilder>Actions>"Strip ProBuilder Scripts In Selection" if you want to remove the extra probuilder scripts from your object.

avatar image AnomalousX12 Hartnett · Jun 13, 2018 at 04:19 PM 0
Share

This is the thread I should've responded to, so I'll respond here as well.

Probuilder seems like a great tool and I'm glad you've gone around updating all the different threads with this question. Unfortunately for me, however, I haven't been able to get your solution to work for me. I have a 3D object which is a star that I imported from Tinkercad which is enormous and off-center by default, and I have a single script that manages all of the shapes in my game. That's easy when every other shape has an accurate transform, but my star does not because of its transform coordinates that are not actually reflective of the shape.

When I "Probuilderize" my star, then move it to where I want it to be as 0,0,0, then hit "Freeze Transform," the star shrinks! And none of the coordinates are reset to 0. They all stay the same. No errors or issues pop up. I just have no idea why it doesn't work. I can take a video if you'd like.

Show more comments
avatar image
11

Answer by Kurt-Dekker · Oct 26, 2018 at 01:22 AM

@cyllu2 Many of these incorrect answers are how to move mesh geometry relative to the transform position, and do so using the features of ProBuilder.

The actual correct answer to the OP's question is that "No, the Transform in a GameObject cannot do that." The work-around is what was posted by @Mindmapfreak : use another parent GameObject where you want the pivot to be.

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 mokhabadi · Mar 02, 2020 at 08:01 AM 0
Share

this create more problems that it get the remedy!

avatar image
8

Answer by Mindmapfreak · Jun 25, 2016 at 05:30 PM

You can find answers to that here, here and here.

You can embed your model inside an empty GameObject and position it wherever you like - this allows you to create any pivot point if you then use the outer game object.

I am not sure what you mean by "middle axis" ...

Comment
Add comment · Show 4 · 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 alexanderameye · Jun 25, 2016 at 05:32 PM 1
Share

hmm, yes I saw those answers, I was wondering if there was a better solution :) I'll take a look at that guy's script, thanks!

avatar image Raresh alexanderameye · Jun 25, 2016 at 05:33 PM -1
Share

This is the "better" solution. It's the simplest too.

avatar image Mindmapfreak alexanderameye · Jun 25, 2016 at 05:36 PM 2
Share

The best solution probably is to set the pivot point correctly in your modeling software ;)

avatar image cyllu2 · Oct 18, 2018 at 02:42 AM 0
Share

NONE of those answers actually answered the question. Am I on StackExchange?!

avatar image
1

Answer by zleereed · Aug 01, 2019 at 02:45 AM

in most 3d modeling software you hit 'insert' key to change the pivot point of an object. Unity doesnt do that? Seems fundamental?

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 Brain-_-Fail · Dec 12, 2019 at 04:08 AM

Unfortunately in Unity, modifying the actual pivots is not possible out of the box. I know this is really annoying and something that i always wanted in Unity. So i decided to create an editor utility for the same.

You can try out my asset here:

https://assetstore.unity.com/packages/tools/utilities/pivot-modder-152501

It allows you to modify pivot position and rotation conveniently from within the unity editor, it also provides you with various useful options like pivot snapping which allows you to manipulate the pivot more precisely. It also fits right within the inspector and needs no addition of components and opening windows from the editor.

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 eriknastesjo · Jan 04, 2020 at 06:34 PM 0
Share

Seems like a well made asset! But I need to change the pivot point during the game through script. Is that possible with Pivot $$anonymous$$odder?

avatar image Brain-_-Fail eriknastesjo · May 22, 2020 at 05:17 AM 0
Share

Yeah that's absolutely possible with the runtime APIs and it does it blazingly fast too. Read the API docs here https://brainfail.000webhostapp.com/pivotmodder_runtime_api_docs/html/class_pivot_modder_runtime_1_1_pivot_modder_runtime.html

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

64 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 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 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

Undesired Angles with transform.Rotate(...) 0 Answers

Is this possible?? (details below) [with pictures] 0 Answers

Making Prefabs with new origin from imported model? 0 Answers

Quaterinon.Euler(0,0,somevalue) has no effect when rotating around a point 1 Answer

stop rotate when player get closet to the object,stop rotate object when player get close to the object 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