How do I Pin a sprite to another sprite on one axis only?

  • Is it possible to pin a sprite on one axis only?

    So that it moves along one axis with the parent sprite but is free to move along the other freely?

  • system > ever tick | objPinnedSprite > set position x= objOtherSprite.X

    for Y you take whatever you like (eg. Mouse.Y)

  • Thanks, I tried this however the Y axis in this case is being controlled by physics and when I do this I get sporadic results.

    I need to find a non intrusive way to pin the pinned sprite to the x axis of the other sprite so that the physics on the y axis are retained

  • here i would try a helper Sprite (invisible) that has the physics behaviour attached

    Now you can set position of your visible Sprite to .... (see example above only the other way arround)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks again, I tried this also.. as well as attaching the physics and the movement together to the visible sprite.

    On both occasions the re-positioning of the x axis from the movement seems to interfere with the physics engine and the sprite ends up moving erratically away from its location as it attempts to complete it's own repositioning

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