Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
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?
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:
Develop games in your browser. Powerful, performant & highly capable.
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.