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 Pauls · Jan 19, 2013 at 04:32 AM · mobilefreezeragdollandroid2.2

Ragdoll : slight pause before it starts?

Hi,

i am using a ragdoll on my ZTE Android 2.2, it works fine, except that just before the ragdoll starts to fall down : there is a slight pause for about 1 second or less. But then, the ragdoll works fine.
I thought the problem came from the loading, so i loaded an instance of my prefab first, in the function "Start", i waited a bit and triggered the ragdoll. But same result. Do you think it is because of my device? Or because of the ragdoll itself on mobile?

I have one character : 1800 faces, 25 bones
and then i instantiate a light version for the ragdoll : 1200 faces, still 25 bones
Would you know any tip to make this work without this slight pause?

Here is the code i am using :

 private var instance : GameObject;
 private var instanceT : Transform;
 
 function Start () {
     instance = Instantiate(Resources.Load("runpref"));
     instanceT = instance.GetComponent(Transform);
 }
 
 function Detonate () {
     Destroy(gameObject);
 
     if (instance) {
         CopyTransformsRecurse(transform, instanceT);
     }
 }
 
 static function CopyTransformsRecurse (src : Transform,  dst : Transform) {
     dst.transform.position = src.position;
     dst.transform.rotation = src.rotation;
     
     for (var child : Transform in dst) {
         // Match the transform with the same name
         var curSrc = src.Find(child.name);
         if (curSrc)
             CopyTransformsRecurse(curSrc, child);
     }
 }

 function Update () {
     if ((Input.touchCount > 0) || Input.GetKey("z")){ 
         Detonate();
     }
 }



Thanks a lot

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by justin35f · Jan 19, 2013 at 04:49 AM

Try to instantiate it in the Awake() function. I believe that this triggers slightly before Start() function.

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 Pauls · Jan 19, 2013 at 05:33 AM 0
Share

Thanks, no unfortunately it does not work, i still have the same pause...

avatar image justin35f · Jan 19, 2013 at 05:54 AM 0
Share

That's unfortunate. For future reference though:

The Start function is called after all Awake functions on all script instances have been called.

This comes from the Start page in the Unity script reference docs.

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

10 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

Related Questions

Android 9 - Graphical freeze but scene runs in the background 0 Answers

Can i build for Android OS 2.2 with SDK v4 level r14? 0 Answers

Unity android huge fps drop on new devices 1 Answer

Is using ragdolls practical on mobile devices? 1 Answer

Game stuck when built... 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