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 dCalle · Nov 03, 2016 at 02:13 PM · rotationrigidbodytransformphysics2dchild

Rotating Children as Rigidbodies2D because transform rotation is too costly

Well it turns out to be quite the fiddling with the physics engine. But here is where I am stuck orjust need some timeout because I had enough...

2D Spaceship TwinStickShooter. I got like 300-500 pooled projectiles flying, homing and ricochetting at a stable fps of around 150 (hopefully it is my shitty laptop makes this drop to that low fps...).

I got a Problem with activating and disabling the Gameobjects, as this seems to be expensive.

Now I built a turret mounted on the ship.

The turret gets parented at a relative position of a child Transform. rotating this at some point becomes costly. I tried to replace the transform rotation with a rigidbody rotation, but whenI'm doing this, it doesn't stay put and I have to actualize its position, which is another pain, as rigidbody.position gets materialized in the fixedupdate cycle, so I can't just update it in the regular Update cycle.

I don't know If i'Il have to use a rigidbody without a collider, with a collider and what I have to do to make it stay put in position.

Am trying to align the rigidbody's velocity with the ship's, maybe that'll solve the problem, but I have just reverted to the transform solution. Am doing it tomorrow.

Right now I'm just stumped. Is there a better trnasform rotation solution I'm missing, because Physics2D.UpdateTransforms explodes when I push an enemy ship around, making it rotate... with just 5 ships floating around (each 2 turrets)

So, Any suggestions?^^

(maybe I could stabilize the ships rotation through the yet nonexistent AI maybe that will help to stop too much rotation. on the other hand: why is rotating so costly, that makes it such a big deal?)

Alright I leave it for you now, I got to get some sleep...

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 Glurth · Nov 03, 2016 at 03:06 PM 0
Share

I cannot see how using the physics engine to do a rotation could possibly be more efficient that perfor$$anonymous$$g the rotation on your own. The final step: adjusting the rotation, should even be the same. Perhaps you used a costly method to compute the rotation needed, or something like that (targeting CAN be expensive, depending on how you do it).

0 Replies

· Add your reply
  • Sort: 

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Rotation issue with remote players projectiles 0 Answers

How to lock X rotation; broken script 0 Answers

Network Transform Slow Rotations 0 Answers

How to find the angle of a rotation? 1 Answer

Separate child rotation 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