How stop Custom Movement when it reached the position

  • Hey

    I want move menu object from left to right in the stary of layout. I tried use 8 direction but it won't work when got solids on his road. What is the best method for moving an object from left to right.

    Now I trying Custom Movement but object wan't stop when reached the position.

    This not work, it won't stop:

  • X and Y coordinates almost always will be in fraction of a pixel, for example x=49.028388481, y=432.1493800217

    You should try something like this:

    System -> Compare two values -> Distance(sprite.x, sprite.y, 49, 432)<2

    Also, check the MoveTo plugin:

    It's easy to use (easier than custom movement) and I think it has "On reached destination" event.

  • System -> Compare two values -> Distance(sprite.x, sprite.y, 49, 432)<2.

    dop2000

    Eh it not working, I think it should be something simple to fix this.

    Now I stopped it using "wehen overlapnig another object" but it's littel tricky

  • It should be working, maybe it's off by more than 2 pixels.

    Also I mixed up x and y in my previous comment.

    try

    Distance(sprite.x, sprite.y, 432, 49) <50

    If it works, try <20, then <10

    Or use MoveTo plugin.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It should be working, maybe it's off by more than 2 pixels.

    Also I mixed up x and y in my previous comment.

    try

    Distance(sprite.x, sprite.y, 432, 49) <50

    If it works, try <20, then <10

    Or use MoveTo plugin.

    dop2000

    I gave <10 and it's work Perfect ! thanks much man!

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