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 mtsi_tims · Dec 05, 2015 at 06:11 PM · transformbuildpositionbug

Why does moving a game object transform work in the WebGL build but not the Windows build?

So I've run into a strange problem. I wanted to make a room where objects could be manipulated with the mouse cursor, but I discovered some objects wouldn't move. So I simplified the project into a single room with two buttons, one that moves the ceiling and one that moves the walls, using the following function:

 public void MoveObjectUp(GameObject objectToMove) {
     string dbMsg = "Original Position" + objectToMove.transform.position;
     objectToMove.transform.position += new Vector3(0.0f, 1.0f, 0.0f);
     dbMsg += "New Position" + objectToMove.transform.position;
     Debug.Log(dbMsg);
 }

So here's the weird thing. If I have the windows build set, only the ceiling can move, but not the walls, which happens in both the editor and the exe. However, if I build it in WebGL, it works in both the built html AND the editor! So changing the build is changing the game's behavior in the editor. Is there some bug in the windows build that's not in WebGL? The WebGL behavior should be the correct behavior.

The debug message indicates that the walls position is moving, but in the game it doesn't look like it is, like there's some disconnect between the mesh and the transform. Also, it seems like even for the windows build, the wall colliders are moving because I can walk through the wall after moving it high enough.

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
Best Answer

Answer by kyljnkns · Dec 08, 2015 at 12:02 PM

@mtsi_tims

This problem has actually happened to me before. Chances are that the objects you can't move have Static Batching. You can read more about that here:

http://answers.unity3d.com/questions/1107699/why-does-moving-a-game-objects-transform-work-in-t.html

So for the objects you can't move, in the upper right of the object inspector, uncheck Static (there are several things that can be set to static, and "Batching Static" is the only one you actually have to uncheck). Hopefully that will fix your problem.

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 mtsi_tims · Dec 08, 2015 at 03:29 PM 0
Share

That was exactly it! That was certainly a simple, though a bit obscure solution. Thanks a bunch!

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

Distribute terrain in zones 3 Answers

transform.position = new Vector 3 NOT moving to correct position? 1 Answer

during build object moves different position than editor(vr) 1 Answer

got char stuck near objects. 1 Answer

Discrepancy Between Editor and Build World Transform Positions 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