Moving stacked object with the object below (in same family)

0 favourites
  • 3 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have a family of objects (with solid, platform and sine behaviors) that can move left/right and turn on collision with walls or other objects in the same family. In addition to moving horizontally, they can also move vertically up and down with sine behavior at the same time. Essentially, I'm trying to create boxes overlapping water moving left&right (and up&down by sine movement to simulate waves).

    This works well, but I'd like to be able to stack other boxes in the same family on top of these moving boxes (and have them move with the moving object). If I set the solid behavior on the stacked box to disabled, it follows the moving box as intended and the turning (on collision with wall) for moving box works. However, if I keep solid for stacked box enabled, the stacked box will follow the moving box until collision with a wall, but then prevents the moving box from changing direction/moving back as it normally would. This occurs even when the vertical sine movement is disabled altogether. Also, for my game I need to keep solid enabled for both boxes as I don't want my characters going through them.

    How could I make the stacked box follow the horizontal/vertical movement of the box it's standing on (in the same family) ? Thanks for any help!

  • I've been thinking about this and I can't come up with a solution, it sounds like a bit of a mess really. There is probably an easier way to achieve what you are trying to do with platform attached to platform but I can't see the game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Some quick ideas, haven't tried though.

    Generally speaking it sounds like you have a physics situation without using physics behavior. Have you tried setting up a physics environment to see if that would be suitable?

    Otherwise, maybe use a pinning system for stacked objects, and unpin them upon collision.

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