How do I Move the Camera

0 favourites
  • 5 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • There's a point in my game where I need to move the camera away from the player, to another point of interest.

    How do I go about moving the camera to a certain X co-ordinate without moving the player? I'd like to to be a smooth scroll to the point of interest, no immediate transitions thanks! ^-^

    Please be thorough with your replies.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have been looking for something same. I hope someone helps

  • This can actually become a fairly complex system. To start experimenting: What I've found to be useful is setting up a sprite that has the scroll-to behavior and having a numeric variable on it that I can adjust at will.

    So for instance, if the camera state is 1, it sets position to player.imagepointx(your imagepoint here)/player.imagepointy(your imagepoint here) every tick.

    You could have other sprites in the game that can be set to invisible that, when colliding/overlapping the player, can change the numeric value of that camera sprite's variable (let's say, to 2) and have that sprite set it's position to another x/y location or object location.

    I would also recommend reading up on lerp and using that to lerp from one position to the other so that you can get a smooth transition from point A to point B.

  • add a sprite, give it scrollto behaviour, call it camera, pin it to the player..

    when you want the focus to change, unpin the sprite and use one of the many movement behaviours to move it to the desired position.

  • Thank You guys! That really helped! cheers

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