Issue with Drag & Drop and Animation in Construct 3

0 favourites
  • 5 posts
From the Asset Store
Casino? money? who knows? but the target is the same!
  • Hi everyone,

    I'm working on a 2D game. I'm facing an issue with the Drag & Drop behavior and animations. Here's what I'm trying to achieve:

    I have two sprites: "watering_can" and "plant."

    Both sprites have the correct animations set up. The "watering_can" has an animation for watering, and the "plant" has "plant_dry" (1 frame of the plant dry) and "plant" (animation from dry to green/healthy).

    The "watering_can" has the Drag & Drop behavior, and the "plant" has the Solid behavior.

    On start of layout, the "plant" animation is set to "plant_dry" (play from beginning).

    When the "watering_can" collides with the "plant," the "plant" animation should change to "plant" (play from beginning).

    If the "watering_can" is moved away from the "plant," the "plant" animation should go back to "plant_dry" (play from beginning).

    However, when I play the game and drag the "watering_can" over the "plant," nothing happens. The animations don't change as expected.

    I've checked the collision polygons, animation names, and sprite behaviors, but I can't seem to find what's causing the issue.

    Any help or suggestions on what I might be doing wrong would be greatly appreciated!

    Thank you in advance!! I have attached a screenshot of my eventsheet here :

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I believe you have a mistake in event #2 - you want to change animation to "plant" there, not "plant_dry".

  • I fixed the mistake in event 2, however, the animation still does not play when I drag and move the watering can over the plant!

  • Do you have collisions enabled on everything? I always double check this.

  • winkr7

    I fixed it! There were no mistakes in the functions. Instead, there were no eventsheet chosen for the layout. I added the eventsheet in the Properties > EventSheet and Now its working!

    Thank you for trying to help!

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