Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 NathanJSmith · Jun 06, 2018 at 10:58 AM · transformmodelfbx

Unity - How to make child object's local position zero as default for Fbx file?

I try to create breakable object like in this video: https://youtu.be/CIRuczIvB9A

At first try, I export the breakable object as Obj file, it works great: all child objects' local position is zero.

So with this prefab (Obj model) in my scene, after I break the object, I can re-construct the project by resetting all child objects' local position to zero:

 foreach (Transform item in transform)
 {
     item.localPosition = Vector3.zero;
     item.localRotation = Quaternion.identity;
 }//Everything works OK with Obj model :)

At second try, I export the breakable object as Fbx file, it doesn't work as expect: The child objects' local position isn't zero. FbxChildObjectLocalTrans.PNG

I think if it works with Obj model file, then there must be a way to make it work with Fbx file. So how to make child object's local position zero as default for Fbx file?

The question I wanna have answer is: why "Obj Model" has child local position zero as default, but "Fbx model" doesn't?

Thanks.

fbxchildobjectlocaltrans.png (10.3 kB)
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
1
Best Answer

Answer by Kciwsolb · Jun 06, 2018 at 01:29 PM

I use Blender, but you can do this in any 3D modelling software. An objects (0,0,0) position is based on its origin. If you go into your modelling software and select all your objects, then apply location (ctrl + a -> location, in Blender), then the origin of all your objects should move to be at (0,0,0). This means when you export as .fbx and import it into Unity, your child objects will all have a position of (0,0,0), but the geometry will still appear to be offset.

Look at the following image (in Blender, but it's the same idea in any program), notice how the location is at (0,0,0), but the geometry is still offset from the origin (the orange point).

alt text

The advantage to this method is that when you reset the position of all your child objects, they will go back to their original formation. So, if you had a breakable box, when you reset it it would look like a box again. I believe this is the behavior you are looking for. I do not use .obj often, but I am guessing (lots of emphasis on guessing) it was doing this for you on export.

Maybe someone who knows 3DS Max can comment the key presses required, or you can just google how to apply location in 3DS Max.


offset.png (51.1 kB)
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 NathanJSmith · Jun 20, 2018 at 03:08 AM 0
Share

In $$anonymous$$aya, it's pivot point. But I think there is disadvantage: If the pivot point is outside the object, then you can't detect the real position of the object in Unity.

avatar image
0

Answer by tormentoarmagedoom · Jun 06, 2018 at 11:20 AM

Good day.

As i understand, when you export the object from your 3D modeling program, the childs get a position that is no 0,0,0 so you can not easy reset its position. Is this?

You have 2 options:

You don't need to have them a 0,0,0 position to reset it. Maybe you need to just store the initial position in a Vector3 variable, and use it when you want to "remake" the ball.

The other object, is to create emptyObjects childs of the ball (lets call them "part"), at 0,0,0. And then make the fragments childs of this empty objects called parts, and move the "part" objects to destroy the ball, so you only need to move the "parts" objects to 00 to recontstruct them.

Bye!

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 NathanJSmith · Jun 06, 2018 at 12:25 PM 0
Share

Thank for your answer, I appreciate it, you understand me correctly. So I understand your option 2 like the picture below Fbx child local pos hack So it works but it requires me to create too many empty objects. I still want to find a way to make it works like the "Obj model" like I mention in the question.

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

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

Maya models and lightmapping issue 1 Answer

How to import models with textures applied. (FBX Embed Media?) 2 Answers

Selecting transform in FBX hierarchy csharp script 1 Answer

reversed faces 1 Answer

How to import player model from 4.0 demo project 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