I want to make it so that the camera shouldn’t go below floors but when you’re in the air it should center on your character.
So in this below screenshot, I want it so that the camera doesn’t go below the red lines in you’re in that “room” or place. but i want it to center the player if the player is anywhere in the air or on platforms.
I want this possible to be extended to certain walls as well so when you stand next to a wall it wont center your character but rather show as much of the room as possible.
some games that do this for instance are games like hollow knight where if you stand at a certain wall your character isnt centered and the camera doesnt go below the ground
I think what i want is for the camera to when it’s in collision with an object not move past that object somehow.
So if the camera Y axis is in collision with a “CameraBarrier” object that’s below us don’t move the camera further down on the Y axis than that object. and same for a “CameraBarrier” object to the left, right or top of us, where the camera shouldnt move further on that x or y axis past the object.
In the example below i’m thinking the green transparent boxes would be the “CameraBarrier” objects
You can try adding an object as a camera tracker then center the camera on that tracker instead of your player, so calculate the distance between the player and the tracker and it’s X/Y and move the tracker down/up when you need so the camera will always follow the tracker.
Here an extension that maybe helps
Ok, I don’t know if this is the effect you want in this game is the implementation with that extension
As you can see the camera follows the trackr but is set to be faster so it seems to follow the player, and the scenarios are revealed as the tracker distance to the player
I think what i want is for the camera to when it’s in collision with an object not move past that object somehow.
So if the camera Y axis is in collision with a “CameraBarrier” object that’s below us don’t move the camera further down on the Y axis than that object. and same for a “CameraBarrier” object to the left, right or top of us, where the camera shouldnt move further on that x or y axis past the object.
In the example below i’m thinking the green transparent boxes would be the “CameraBarrier” objects
That is because is a camera limit to the stage size and the X/Y movements is to fast you can control the speed of the lerp so the camera moves slowly. I know there is another extension I think is on the Extension inside the GD you can control the speed even the zoom
Edit: [Extension] New AdvancedPlatformCamera Behavior
in that example the camera is completely still when you’re on the platform that’s not what i want, i still want it to move on the x axis when the character moves i just don’t want it to go below a certain point below it. and to not go past a certain x point when close to a wall.
ooh my bad i didin’t check properly you can just change the x value to the not in collision value it should work then i just tested about the wall part i haven’t worked on it
After some advice over on the discord on not making the scenes too big i’m going with the simpler boundaries solution of this… it didn’t properly “solve” my issue but i feel like i have to if i dont want to hamper performance
I’ve been thinking about this some more and doing some research with more storied game devs than I, and I’m starting to think we can do the “adaptable camera bottom/top based off platforms” from Hollow Knight by using Raycast conditions/actions.
I need to think some more on how to implement it, but watch this space and/or the discord for more info if I come up with a solution.