Hello
I’m a bit confused with a problem I’m facing.
I need my player to have the camera centered on him. However, when the game is run, the camera is centered but the ground is no longer at the bottom of the screen. Instead there is a large gap.
As you can see, there is a large gap. One person was kind enough to try to help but his verbal and visual explanations were not helpful enough for me to solve this.
Any help would be greatly appreciated!
Muzan
September 25, 2021, 3:34am
#2
You need to increase the height of Platform
What? Like make it bigger? That would ultimately go outside of the black scene box and that makes things messy.
Muzan
September 25, 2021, 3:36am
#4
Yes. That black box is nothing but a box with height and width of your scene drawn from 0; 0 co-ordinates.
Then it starts to look too large like the following:
Muzan
September 25, 2021, 3:40am
#6
A little bit more. Increase height a little more.
[edit]
I think that is black bar and not flying platform. So, no need to increase it.
MrMen
September 25, 2021, 3:43am
#7
Yes, because the camera has dropped down to be centred on the player (or, in other words, the player is at the centre of the screen).
D you want this, or do you want the camera to be horizontally centred on the player, but not vertically?
Muzan
September 25, 2021, 3:43am
#9
Then change the X position of Camera to Player.X()
I don’t want the platform that big. I want it thin and the player to be followed by the camera.
That worked however now when the player moves, the camera doesn’t follow him.
Muzan
September 25, 2021, 3:48am
#12
How did you do it? Can you screenshot it?
Use Snipping Tool to screenshot
Muzan
September 25, 2021, 3:50am
#14
Weird. It should always follow Player.
It doesn’t.
Maybe it’s the no change to screen?
Nope. Not that. Well, this is unfortunate.
Muzan
September 25, 2021, 3:54am
#17
Hey. I got it. Your Player’s name is Diego and you are changing Camera to Player.X(). Change it to Diego.X()
Oh silly me.
My sprite wasn’t named, ‘Player’, it was named, ‘ZombieBoy’, once I changed it to ZombieBoy.X(), it worked lol.
Diego is a npc lol. He’s an enemy.