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.