Scrolling the camera down

0 favourites
  • 7 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • I've been trying to structure events that will make the camera slowly scroll down the screen at the start of the layout.

    So the camera begins at (0,0) for instance, and will smoothly scroll down the screen until it reaches the bottom of the layout.

    I've tried a variety of things, and for some reason when I do

    At start of layout -> Scroll to (0,0)

    and then something like every 5 seconds, scroll y to current y -5. It does nothing besides the initial Scroll to (0,0)

    I've read all the tutorials and looked at the .capx's for scrolling in the FAQ, but they all pertain to things much more complicated than this. This should be very simple, I just can't seem to make it work.

    Any help?

  • I dont know if it's the best solution, but what i do to move the camera is :

    Create a sprite called "cameraTarget" for exemple

    Make it invisible

    Apply the behavior "scroll to" on this sprite so the camera will always follow it

    Move the sprite down (i would use the bullet behavior in your case)

  • If there isn't a more elegant way that is probably how I'll end up doing it. Thank you.

  • You're not nesting the scroll action in the "at start of layout" condition, right? If so, it'll only fire once and not every tick.

    This works fine for me:

    <img src="http://i.imgur.com/iVpZTZk.png" border="0" />

    Edit: I just reread your post.

    then something like every 5 seconds, scroll y to current y -5

    To scroll down, you need to add to ScrollY. Subtracting will try and scroll up.

  • For some reason that does not work for me, zatyka.

    It has no effect on the camera.

  • It works fine. You have to make an object or background to check if the camera scrolling. If you put empty layout and add the event given by zatyaka, you wont notice the camera scrolling down.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes also make sure your layout is bigger than the window size and you don't have ScrollTo behavior on an object.

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