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
0
Question by idurvesh · Nov 28, 2014 at 08:39 PM · rotate objectdraw callscoinsrotate-around

Multiple coins rotation using script eats draw calls

Hi,

I am using following code to rotate my coins

 void FixedUpdate(){
     transform.Rotate(0, 200 * Time.deltaTime, 0, Space.World);
 }

the thing is , it does rotate on one axis but it eats lot of draw calls .I checked it on profiler, it took around 100 draw calls..

What is the solution to it?

Comment
Add comment · Show 3
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 Graham-Dunnett ♦♦ · Nov 28, 2014 at 08:39 PM 0
Share

Rotating an object doesn't increase draw calls.

avatar image idurvesh · Nov 28, 2014 at 08:42 PM 0
Share

Yes that should be the case,

but when I deactivate script it do not freezes game, but when I activate the script in profiler it shows 100+ draw calls....In my script I only have above code mention...

avatar image idurvesh · Nov 29, 2014 at 09:39 AM 0
Share

nobody????

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by dudester · Nov 29, 2014 at 02:28 PM

what you could. try is if your coins are models not simple cylinders try compress the mesh just click on the model there will be an option called mesh compression just set it to high.or add a rigid body to it.cause moving non rigid body's is quite expensive as far as I 've read.hope I've helped a bit.

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 idurvesh · Nov 29, 2014 at 06:52 PM 0
Share

Yes it already set up like that bro ...

avatar image
0

Answer by keni4 · Nov 29, 2014 at 02:29 PM

Don't know how about draw calls, but at first Time.deltaTime is for Update() and Time.fixedDeltaTime is for FixedUpdate(). Second - Time.fixedDeltaTime - is a constant, so you can create global variable in the top of a script somthing like this:

 Quaternion deltaRot = Quaternion.Euler(0f, 200f * Time.fixedDeltaTime, 0f);

Then in FixedUpdate() just use this in that way:

 transform.rotation *= deltaRot;

May be this will help)

p.s. use float numbers with "f"... "0f" instead of "0" etc.; and sorry for my english

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 idurvesh · Nov 29, 2014 at 06:52 PM 0
Share

thanks, tried this but no luck :(

avatar image
0

Answer by FlashX · Nov 29, 2014 at 11:25 AM

Have you tried banging just that line of code in a new project to eliminate everything else?

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 idurvesh · Nov 29, 2014 at 12:04 PM 0
Share

I just did that, but no luck,

alt text

Similar problem I found here but not sure whats the thing, Check in

http://answers.unity3d.com/questions/353427/how-to-do-one-draw-call-out-of-a-rotating-coins.html

capture.jpg (13.4 kB)
avatar image
0

Answer by psycocrusher · Nov 29, 2014 at 08:41 PM

They all need to have the same material an respect the dynamic batching guide lines:

http://docs.unity3d.com/Manual/DrawCallBatching.html

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

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Best rotation function to use 1 Answer

My GameObject does not rotates. 2 Answers

how do I make a obeject (player) move the way it's pointing ? (like a jetpack) (c#) 1 Answer

Rotate a gameobject by a specific angle and stop when character doesnt move anymore 0 Answers

Rotate object based on FPSCamera 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