How do I make the camera follow player only inside layer

0 favourites
  • 4 posts
From the Asset Store
94 Inside buildings views - Isometric view - PNG transparent - 2048x2048
  • Hello,

    If I set the player behaviour scroll to the camera centers the player, but it displays portions outside of layer when the player is close to the edge.

    I want the camera to follow the player as it is now but to stick inside layout.

    How can I do that?

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've never had this problem with the scroll to function, are you sure its not because you have your layout smaller than your screen size? Or maybe you have your layout bigger than your level? The scroll to function goes off the Layout width and height, and I have just tested it and it stops as soon as it hits the layout edge. Any screenshots that might help?

  • I solved this by adding a sprite called camera with bound to layout and scroll behavior and every tick camera x set to player.x and camera y set to player .y

  • You might want to try pinning the Camera sprite to your player as the 'every tick' function can take up valued memory resources, especially if your going to be putting your game on a mobile device.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)