Player Camera

0 favourites
  • 8 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi! I've created a camera spirit to follow my player using the lerp code "lerp(Self.X,Player.X,0.1)". I've already added the scroll to behavior to my camera spirit too. But the camera still does not follow my player at all. Is it because of my background movement? Or is there anything I need to do to my player to make the camera follow? Thank you for your help!

  • If you make the camera sprite visible, does it move to the player?

    Make sure you don't have other objects with ScrollTo behavior.

    Enable "Unbounded scrolling" in layout properties.

    Check that the layer has parallax (100,100)

  • If you make the camera sprite visible, does it move to the player?

    Make sure you don't have other objects with ScrollTo behavior.

    Enable "Unbounded scrolling" in layout properties.

    Check that the layer has parallax (100,100)

    1. When I make the camera sprite visible, it will move to the player

    2. Only the camera sprite has ScrollTo behavior

    3. When I enable "unbounded scrolling", my background does not cover the entire screen and there's white spaces. My layout and viewport size is 960x 540.

    4. I cannot find the parallax.

  • Just to add on, I found the parallax!!! It's 100x100.

  • 3. When I enable "unbounded scrolling", my background does not cover the entire screen and there's white spaces. My layout and viewport size is 960x 540.

    This is the problem. Your layout size is the same as the window size and you don't allow to scroll outside of it.

    You need to make the layout size bigger - the same as your level size. Or enable unbounded scrolling and limit camera movement.

  • > 3. When I enable "unbounded scrolling", my background does not cover the entire screen and there's white spaces. My layout and viewport size is 960x 540.

    This is the problem. Your layout size is the same as the window size and you don't allow to scroll outside of it.

    You need to make the layout size bigger - the same as your level size. Or enable unbounded scrolling and limit camera movement.

    How do I limit camera movement?

  • Depends on your level configuration. For example, you can do this:

    Set camera x to clamp(lerp(Self.X,Player.X,0.1), 480, LayoutWidth-480)

    or

    Set camera x to max(lerp(Self.X,Player.X,0.1), 480)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Depends on your level configuration. For example, you can do this:

    Set camera x to clamp(lerp(Self.X,Player.X,0.1), 480, LayoutWidth-480)

    or

    Set camera x to max(lerp(Self.X,Player.X,0.1), 480)

    ok noted. I'll give it a try later. thanks a lot!

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