hey, I'm a beginner in programming. I'm in the process of setting the camera in motion. I wanted it to look similar to Sally Face ()
I did everything according to the guide --
However, I still have the same problem with the camera running away.
The video is below
https://imgur.com/a/hJxiuhc
(It also happens sometimes that my player can't go back)
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Post your Camera Setup/Inspector especially the Game Camera like in the Tutorial Video, doesn't seem to be fixed to the Player.
The one at 1:19:40
I suspect that the camera is correct, but there's an issue with the Player - in that the Player's sprite position isn't matching their root position.
Check the Console window at runtime - are you getting any warnings related to the Player's sprite position?
You want to ensure that the Player's sprite object (which should be a child of the root, and assigned as the "Sprite child" in the Inspector) has a local position of (0,0,0).
I'm only guessing here, though: if you can share images of your Player's root and sprite objects, I'll understand your situation better.
It's also possible to test out the 2D Demo's Player prefab in your scene, to compare the difference in behaviour.
To do this, grab the prefab from /Assets/AdventureCreator/2D Demo/Resources/Brain2D, drop him into the scene (and disable your own Player's GameObject, if also in the scene), and run it. Does the same issue occur?
https://imgur.com/a/HeqjL3F
It's Still There (I just increased the sprite and movement)
https://imgur.com/a/SXaIQ96
Check Collapse in your Console to combine multiple messages of the same type - the one about the Animator can be ignored.
Your Scene view screenshot shows a PlayerStart above the NavMesh, in the middle of the door. Does the Player appear in the wrong place if you move the PlayerStart so that it's inside the NavMesh?
If the issue is occuring with the Brain2D prefab, you're welcome to PM me your scene file and I'll take a look.
Earlier it was written about the wrong setting of the "Sprite child" position. I fixed it, but the error with the camera running away still appears https://i.postimg.cc/bw2PyxPn/cxvxcv.png
https://imgur.com/a/5b6k4iN
I'm not sure if I understood the second sentence correctly.
However, it seems to me that the problem is with the camera.
It could be a result of your camera's Offset and Track freedom values, which are both very high.
If the Offset was set due to an earlier issue with the Player's sprite position, you should be able to set this to zero.
The Track freedom value represents how far the Player can move off-centre before the camera starts to move. Set this to zero - even if temporarily - to see if that's the cause.
If the camera still has issues, send me a link to download the scene file to me (click Message in my profile page) and I'll take a look.
Thanks for the file.
The issue occurs because your game is scaled in the X direction by the _GameCameras folder it is parented to, which has a non-unit scale.
To fix, set the _GameCameras object's Scale values to (1,1,1), and reposition the GameCamera if necessary.