unity-game-enginebuildcamera

Camera doesn't teleport correctly in build, but does in the editor


I'm making FNAF in unity, and in the editor, I can die and am jumpscared correctly. However, in the build, I'm looking at his feet. See the video below for more context.

I honestly have no clue how to fix this.

I have no clue as to how to make a reproduceable example, since I don't know why it happens.

Post Edit: It's best to just have the jump scare be a different scene, as it's the easiest way to do the jump scare.

Note: Relative coordinates seem to screw up a lot of things, so try to avoid having a camera teleport be a child of an object. If you're just trying an animation (such as a death animation), either use a new scene or just have it be an overlay of a video of the death animation (The death animation in the video should be the 3d one you intended to use)


Solution

  • It's going to be an issue with your build settings or your assigned variables when you built the game.

    If the jumpscare is a separate scene, make sure it was included in the build and that the variable reference is set properly at the time of build.

    In response to your added info:

    Making a new scene should work, but since it is in the same scene already, some alternative options are