Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
I have this big room that's 2 times the size of the viewport, I want the viewport to follow the player, but not show outside the room (so if the player kept moving up the viewport would stop at the wall). Any idea how to do this?
Develop games in your browser. Powerful, performant & highly capable.
If there is only one room on the level, you can resize layout to room size and disable unbounded scrolling.
If your character can travel from room to room, check out this demo:
I tried to make a camera sprite free version, ignoring the first part about if the room is shorter, do you know where the failure was?
Here is a slightly better version:
You can add lerp(scrollx, clamp(....), 0.1) to make it smoother.
I still prefer to do it with a Camera sprite and MoveTo behavior, because you can configure nice acceleration and deceleration effects.
Thanks dop! Wasn't working at first in my project but it turned out I just named a layer wrong xD
All is sorted now though, thanks alot!
how should i go about doing that clamp? The target position is 3616. Sorry i cant figure this out for the life of me.