How to make plants move when the player collides with them by code?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • Hello everyone! 🌿

    I already have my player moving in the game — everything is working fine. I also have plants placed in the scene.

    The setup is like this:

    PlayerMove handles the player’s movement.

    Player handles the player’s animations.

    Now I’d like to add a small effect:

    👉 When the player collides or walks through the plants, I want the plants to sway or move slightly, as if reacting to the player passing by.

    Could someone please show me an example or suggest how to code this effect?

    Any help would be very appreciated! 🙏

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello.

    Add the Tween behavior to the plant, and you will have many options.

    I wanted to write it in text, but adding an example in a few lines will be faster.

  • That Helps alot! I gonna try it. Thank you so mutch Igortyhon!

  • you could also have an animation that plays when the player moves on the plants.

    two conditions-grass is overlapping player, and player is moving

    then, have it play the animation, and have a separate event when the player stops moving that stops the grass on the middle frame of the grass moving animation.

    P.S. this was my idea for stuff like how the grass moves in games like pokemon.

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