I recently ran into a problem within a Game I am working on. That being said, my camera is not moveable whatsoever when I hit play. I checked through my scripts and could not find any code that changes anything about the cameras transform, resetting it to the start point. My Camera has an animator, however it is in an idle state, which does not have any movement. I tried taking off the camera references from the canvases i am using and turned them into world space mode. Even that did not help, now i am desperately looking for a solution on here, any tips/hints/solutions would be very appreciated!
Btw, I wrote a very basic script to check if the camera would move, which just has a
method in its update method, nothing else, and is attached to the camera.
I also tried disabling the animator and the animation script i attached to it, so that the position would for sure not get reset by some animation, still no success.
Does your animation state have “Write Defaults” on? That could be the culprit.
“Whether or not the AnimatorStates writes back the default values for properties that are not animated by its Motion.”
EDIT: Ah, missed your last sentence about disabling the animator. If that is indeed the case, then I would guess there is actually some script reseting its position.
EDIT 2: Is your camera root object or is it a child of something else? Could its parent be settings its position? Also try doing the Translate in LateUpdate instead, in case something else is reseting its position in Update.
I found the Issue, I changed the animation script attached to the camera in play mode, so it reset when i went on to testing it the next run, resetting my cameras transform.position via script whenever it moved. Sorry for wasting your time on such a stupid mishap, but i appreciate that you actually tried