How do I have an object be animated whilst another object is push/on top of it?

1 favourites
From the Asset Store
112 High-Quality destruction sounds for videogames
  • So lets say that an object (object 1) is moved into another object (object 2), how do I make it so that the animation of object 2 runs whilst object 1 is pushing, or at least on top of it, and stops if Object 1 is not on top of object 2

    Thank in advance


  • Do you mean from a top down view? If so you could use an 'object is overlapping' condition.

  • I did that but the animation does not run while object 1 is on top of object 2/when object 2 is being moved by object 1, but the animation for object 2 does run if object 1 is not overlapping object 2, and the animation loop cycle continues, even though upon start-up the animation does not run

  • 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 2 easy events :

    if 1 is overlapping 2, 2 play animation

    if 1 is not overlapping 2, 2 stop animation

  • The image below describe my issue, object 2 (the marble) does move when object 1 (the pulse) is on top of the object, and the angle change works, but the animation starts and only plays when The pulse is not on top of the marble

    If you can't see the image, then this is what I did:

    Pulse is overlapping marble marble move 3 pixels at pulse.angle

    Marble start animation from current frame

    Marble set animation speed 20

    Marble set angle toward (Pulse.X, Pulse.Y)

  • It's because the event is running constantly and you are telling it to 'play from the first frame' constantly so it will appear static. You can try 'set animation' instead

  • I don't understand, just show me what you mean, of course you can use your own objects, or write it out like I did with Object 1 (Pulse) and Object 2 (Marble) (or whatever you want)

  • you are telling it to 'play from the first frame' constantly so it will appear static. You can try 'set animation' instead

    Change 'start animation' to 'set animation'

  • It's still not working, show me what you mean with a image, or just tell me with what I did previously

    (Pulse is overlapping marble Marble move 3 pixels at angle Pulse.Angle

    Set animation speed....)

  • I've tested the set animation and the animation is not playing at all, but even with set animation and start animation, it still only plays the animation when the Pulse is not over the Marble

  • Ok, so I've made a few changes, and the events (the image below) works while the pulse is over the marble, but the animation doesn't stop when the pulse is not over the marble

  • So, the current events make the marble (object 2, animation is stopped at start of layout) move at the pulse's angle (object 1, change direction towards marble) and the marble will face the opposite direction of the pulse

    When the marble is touched by the pulse, the animation is played, this is what I want, but it continue to play no matter if the pulse is on the marble or not, I don't want this, I want the animation to stop when the pulse is not on top of the marble

    Please help, you can help by using object 1 and 2 (or Pulse and Marble) as a way to describe what I should do, the image below will describe what I have so far (minus animation is stopped at start of layout, and set pulse angle towards Marble X,Y)

    Thank you in advance

  • You should add an event 'pulse is not overlapping marble' and use action 'stop animation'

  • That does not exist, unless your talking about something else, I can not find the "OBJECT is not overlapping OBJECT" event, only the "OBJECT is overlapping OBJECT" event

  • Ok, I have solved is thank you for your help, the image below is what I did

    but to put it in a way that can be used by anyone, lets just say that Object 1 moves Object 2 when overlapping, and Object 2 need to play animation when Object 1 is overlapping

    Note: not going to mention sounds, and I set object 1 as bullet and Object 2 as 8 direction (0 speed)

    Object 1 is overlapping Object 2 Object 2 Move x pixels at Object 1.angle (X can be

    whatever number)

    Object 2 Set angle towards (Object 1.X, Object 1.Y)

    (May need to reverse the animation)

    System Else Stop animation (Else Needs to be below

    Object 1 is overlapping

    Object 2)

    Object 1 is on collision with Object 2 Object 2 Start animation on current frame

    Object 2 set animation to "" (don't think this matters)

    Object 2 set animation speed to x

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