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 /
This question was closed Feb 23, 2015 at 08:40 PM by jpthek9 for the following reason:

Too subjective and argumentative

avatar image
1
Question by jpthek9 · Feb 23, 2015 at 08:58 AM · transformpositioncalculations

How to turn off transform position calculations?

For my RTS game, I can't use Unity's transforms for simulation because of floating-point inaccuracies but I'd like to use the hierarchy for organization. Is it possible to turn off the transform position calculations? I have to set the positions manually and would like to be performance friendly.

Comment
Add comment · Show 9
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 steakpinball · Feb 23, 2015 at 04:24 PM 2
Share

What do you mean "Set the position manually"? To do that you set the transform position.

avatar image tanoshimi · Feb 23, 2015 at 06:43 PM 0
Share

What "calculations" are you hoping to avoid? If you're not using Transform.rotate/translate etc., physics functions or collisions, I can't think what calculations are going on...

avatar image jpthek9 · Feb 23, 2015 at 07:18 PM 0
Share

@brianturner All the simulations will have to be done using deter$$anonymous$$istic math but I still have to communicate with Unity for rendering so every frame I set the transform position.

@tanoshimi I don't want children's positions to be automatically calculated based on the parent's. The only thing I want to do to the transform is a simple transform.position = LerpPos and transform.rotation = LerpRot. That, and turn off the children position calculations.

Please take my word for it when I say that using the transforms for simulation is not an option.

avatar image tanoshimi · Feb 23, 2015 at 07:28 PM 0
Share

So just use transform.parent.position ins$$anonymous$$d...

avatar image jpthek9 · Feb 23, 2015 at 07:45 PM 0
Share

Yes, but that would automatically calculate the child's position...

Show more comments

1 Reply

  • Sort: 
avatar image
-1

Answer by Nymisu · Feb 23, 2015 at 09:09 AM

...You can use the floating point calculations for physics calculations, because everyone else uses them aswell. The inaccuracies in floating point math are in the thousandths of the value, with the trade of 10 times faster performance compared to say, doubles, and with more than twice lower memory imprint.

Most physics simulations do not count anywhere as close as those decimal values, and it'd be completely idiotic to do so aswell, as the user wouldn't be able to tell the difference, outside of having tenth, or less of the performance of a conventional physics system.

In short, the answer is that you shouldn't do it, and shouldn't consider doing it for any reason.

If you're struggling with non-physics based float point variations, use mathf.Round to round out the float value to coordinates.

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 jpthek9 · Feb 23, 2015 at 09:37 AM 0
Share

Thanks, but my game's built on the lockstep system and relies on deter$$anonymous$$istic cross-platform results which means I can't trust the transforms. In any case, I have to use my own physics as I know for sure that Unity's do not turn up with the same results on different platforms. Performance isn't an issue since floats are negligibly faster than doubles, sometimes actually underperfor$$anonymous$$g doubles in tests. If you have an actual answer, please tell. If not, thanks for your input but unfortunately it's not very helpful.

Follow this Question

Answers Answers and Comments

22 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

Related Questions

How can I Instantiate a prefab (projectile) consistently from the character? 0 Answers

Moving object with transform.position ignore other objects even if they collided 1 Answer

Need enemy to follow only active character 0 Answers

Drawing a (debug) line between anchored UI element and mouse? 0 Answers

I need help with the location of instatiated objects on the scene and correct interaction with this 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