Paralax Scrolling

This forum is currently in read-only mode.
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi guys

    Been working hard over the last few days on a project that I came up with while simply experimenting with some stuff... and it became a little more than an experiment in the end...

    Something so simple is frustrating me though... paralax scrolling.

    So far I have made a few layers and adjusted the "scroll x rate" and "scroll y rate" and it seems to work fine on layers that are "above" my character, however if I change "scroll x/y rate" on layers which are "below" my characters layer, it... messes with my character.

    Understand? No neither do I...

    Example of the anomolae, in a practical situation:

    • We have 3 layers, Layer 1,2,and 3.
    • Player character is on layer 2, and can shoot bullets from a gun.
    • Layer 3 is "on top" or "above" layer 2, and has some laterns in the "foreground" which scroll past the player as they walk along, moving in front of the charater. The scroll rate is adjusted to say, 150%.
    • Layer 1 is behind layer 2 and has some trees and buildings which are supposed to move behind the player. The scroll rate is 80%
    • The effect works perfectly fine (visually), until the player starts shooting his gun. When the characters X coordinate and/or Y coordinate are close to 0, everything seems fine, but as the player walks further along to the right (increasing X coordinate), the bullets seem to fire from a point in front of the player instead of from the players gun... the longer you walk along the further the point moves away from the player. I am using an "action point" on my character at the end of the gun.
    • As soon as the scroll rate is set back to 100% on layer 1, the problem goes away but I loose the paralax on the "back" layer

    Anyone else come across this? Am I doing something wrong (I think I am!) to make this happen? I would really like to have a paralaxed background... I could handle it if the foreground stuff wasn't working right, I just wouldn't use it... but having a nice background is more important to me.

    Thanks in advance guys!

    ~Sol

  • ok wow idiot... I have been trying to fix this for over an hour before I posted the question, and I figured out what was happeneing...

    The "bullets" were being created on the wrong layer... DUH

    OK all good, this can be locked, mocked, or lol'd at.

    ~Sol

  • Try specifying which layer you're creating your bullet objects on. That sounds like the problem to me.

    Edit:

    Erp, how did I not see your second post?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Lol posting at the same time for the win?

    Cheers though, if I hadn't figured it out myself that would have done it for me

  • LOL'D

  • How did you solve this? I have the same problem. I`m making a platform shooter and my bullets start spawning away of the character while it moves in X.

    Please help!

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