• 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 frezned · Mar 24, 2012 at 06:18 AM · instantiatetransformposition

Can't alter instantiated object's transform until ~10 seconds

Having a very strange problem, here.

I'm creating an object via Object.Instantiate(prefab), and I'm unable to change it's position until about 10 seconds have passed, whether by setting transform.position or just trying to move it around in the Scene editor.

The code I'm using is just

 Transform cross = Object.Instantiate(crossPrefab) as Transform;
 cross.position = new Vector3(8, 0, 0);
 Debug.Log(cross.position);

The log traces (8, 0, 0) as you'd expect, but if I trace the cross's position on the next frame, it'll show (0, 0, 0) again. It's like there's a script that's resetting the object's position to (0, 0, 0) every frame, although that's certainly not happening in any of the scripts I'm using. (I'm just starting a new project, there's only a few dozen LOC to check).

Setting rotation also doesn't work.

And after around ten seconds have passed since instantiation, I can manipulate the transform in code or in the editor without any problems. Instantiating another object will mean I have to wait another ten seconds until the second object can be moved around, while the first one still moves fine.

If it's relevant, if I parent the newly-instantiated object to an existing transform, and move that parent transform, it works okay. It's just the local transforms of newly-instantiated objects.

The prefabs I'm instantiating are just empty objects with a model attached, with no extra scripting at all. The model is imported from Blender (straight from a .blend file).

Is there anything that might be causing this? I feel like I must be missing something obvious.

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
1

Answer by frezned · Mar 24, 2012 at 06:33 AM

Figured it out, kind of.

The models I was importing didn't have any animations attached, but an animation component was still being added and "Play Automatically" was checked.

I guess it was playing some default animation over ~10 seconds, and that was somehow causing the transform to be reset for that duration.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Dynamically Update Instantiated Objects Position 1 Answer

Offset Position 1 Answer

problem whit Instantiate Prefabs position. 0 Answers

How to only instantiate objects once? 1 Answer

Place object randomly at any predefined spawn point 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