[Solved] Smooth camera & enforce camera border

How do I…

I am using a topdownmovement with 4 directions, which is working as expected.
I have a smooth camera centered on my player.

The baselayer where the player is moving is surrounded by an collision object on each border to block the movement (extra layer) out of the set tiles, and also one to block the camera (base layer) at the border of the tiles.

  • Movement works
  • collision objects work
  • camera followup (not close to a border) works.

But as soon as i get closer to the camera blocking border the smooth camera starts shaking more and more the closer i get to the border, since the centered camera still tries to center on my player.

How can i make sure that the camera stops centering on the player as soon as an hidden „camera blocking object“ gets in the field of view, and resumes centering as soon as the „camera blocking object“ is not visible anymore.

It Currently looks like this:

That centre the camera on slime action is only run once at the start of the scene. Is there another action to centre the camera on the slime?

A few other things - why are you moving the enemies away from Collisions in the beginning of scene? Also, there’s no need for a trigger once in an beginning of scene - all those events only happen once anyway. And is there only 1 InvFrame in the scene?

Thanks for your reply,

The “center on slime” only happens once at the beginning.

For your other questions:
i want to have enemies get blocked by collision items like trees on the map, and not let them pass through. they are set to follow the player if they get in a certain range.

did not know that the trigger once is not needed “at the beginning”, i just deleted that condition.

i have more than one invframe set on the scene to create an inventory and equipment doll.

And it in an “At the beginning of the scene” event, so it wont get actioned during game play. You should move it to outside the “Beginning of scene”.

Same goes for the “center on slime”. It’s inside the “At the beginning of the scene” as one of it’s subevent. Move it to outside of that event.

Then you’ll need to specify which InvFrame to stick the InvSlot to by selecting the InvFrame with a condition. Otherwise they will all get stuck to one InvFrame.

Thanks again,

it now looks like this.

the behavior of the camera starting to shake at the border still exists.

the problem with the inventory is none, the inventory works mostly as expected,
i have a few things handling that down below in the events.
i used the inventory creation guide from winstreak!

and his second tutorial for this:

i found the solution myself:

i had a 2 diffrent parts where i controlled the camera diffrently:

the solution is now like this:

1 Like