Need a way to destroy actor when Interpolating!

beefy_clyrobeefy_clyro Member Posts: 5,394
edited November -1 in Working with GS (Mac)
Yellow.

Basically, i have an actor that is interpolating in width and height. I then have another actor which when touch is pressed and overlapping, destroy the interpolating actor.

If you use interpolate to change co-ordinates of the x and y it will destroy, but when interpolating size, it will not detsroy until the conditions are valid and ONCE the interpolating has finished.

Does anyone know a way of achieving/working around this?

Cheers

Comments

  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    I had a similar problem with Bumps with Interpolate, when i wanted to make them grow 4xs size they stopped rolling until they reached desired width/height.

    Have you tried change size/grow?

    Maybe have a variable that checks if its a certain width and a rule that stops it growing if its over this width?

    Hope they fix this soon.

    Darren.
  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    Ahh i think i know why, I'm guessing you have movable unchecked?

    An actor will not register the collision unless it's movable so when your other actor is overlapping it doesn't register....think that's right but could be wrong.

    Darren.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Ah this is so frustrating!

    Tried to change size and it just grows static, doesnt even keep the animation going! This is a real problem as the aim is for the actor to start small and just interpolate bigger. Once it gets to a certain size (the size its interpolating to) it automatically destroys itself. The aim is to destroy the actor before it interpolates to its full size. I need to think of some kind of workaround as this is the core of the game! D'oh!

    On a seperate email Darren, could i grab your email, got something i'd like to ask ya?

    Thanks
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    @tsb - Yes it will work if you just use touch.

    What i have is an invisible actor covering the scene. When you touch this invisible actor it constrains its x and y positions of touch, to other game attributes (game.touchX and game.touchY). I then constrain a different actors x and y to that of the above touch attributes. When you are touching the invisible actor its set to change a boolean value of game.touch to true.

    So the interpolating actor has a rule like this;

    All
    When game.touch = true
    When overlapping or colliding with actor2 (for example)

    Destroy.

    Thats how its setup and then it doesnt let you destroy it until the interpolate has finished

    Cheers
  • UtopianGamesLtdUtopianGamesLtd Member Posts: 120
    toyboxuk[at]hotmail.com
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Found a solution that worked for me - I wrapped the interpolating actor in a timer and didnt set it to run to completion. This way the size was constantly stopping every 0.5 seconds so the actor knew when it had reached the acceptable size to be destroyed

    Oh and cheers Darren :)
Sign In or Register to comment.