Currently I am working on a game where the camera isn’t moving with the transformer, at least not when I press play:
Where things go right: “Setting Up”
- In Scene View the transformer and camera moves where I wish to position it.
- The game preview shows the camera view that I want to see showing no offset.
- The Game window shows the camera view that I want to see
- Edit: Added Issue, adding new objects with the camera on default layers same as all the other objects are not appearing on the camera. (added edition: only when hinge joints are attached do the objects disappear)
Where things go wrong: “Press Play”
- It’s only when I press play however the camera view doesn’t match up with the scene or Camera preview windows. It’s as though there is an invisible offset on the play camera; and I am not exactly sure how to fix it.
How this effects everything: “Scripts Respond”
- Platformer Pro a script I use responds as if the offset is there, it also responds as if there is an offset on my X axis.
- Conclusion: whatever issue I am having with Unity is effecting my camera scripts.
Usual remedies aren’t working:
- Starting a New Scene with just a camera and essential objects does not seem to remedy this problem.
- Deleting and disabling all scripts don’t remedy the problem.
- Deleting the Camera and adding in a New one also does not seem to remedy the problem.
- I’ve had issues with Unity bugging out on me, where I switch options on the surface, but editor mode (I don’t know how to get into editor mode this is what someone looked at it and told me) behaves as though the options weren’t changed, and then has to be manually fixed. I do not know how to go into editor mode to do this myself. And I’ve never touched anything related to offset that I know of, the Camera was fine one day, and not the next.
- Short of trying to rebuild the entire game I have over from start to finish again I don’t know what to do to fix this.
Some other ideas:
- When I tried to move the platform that the player stands on the camera using the platformer pro script it follows the player as it falls onto the platform and the invisible Y offset is still there.
- This leads me to believe this is an issue with the Platformer Pro scripts on the character, at the very least as it relates to the Y axis.
- I remove all the scripts leaving nothing but the sprite and rigidbody2D completely on this and again I still have the X offset issue, so at the very least that seems to be a Unity problem, and I suspect whatever the issue is with unity is inadvertently effecting my scripts.