Actor with Interpolate behaviour does not detect collides or overlaps with

neomanneoman Member, BASIC Posts: 826

Hi Guys,

I am working on a simple mini game demo where sheep will be spawned on the screen. The aim of the game is to drag the sheep into the back hole (which is spinning and changing size using interpolate) and see how many you can get in the allocated time.

The issue I have encountered is:

I have an actor BlackHole which spins and then changes size using interpolate. When the second actor Sheep collides or overlaps with it, it is supposed to get destroyed and a sound should play but nothing happens once the interpolate behaviour takes effect. I tested the same project using 13.36 and it had the same issue.

Not sure if the interpolate behaviour applied to an actor affects it when it overlaps and collides with another actor. If the interpolate behaviours are turned off everything works as expected.

I found two ways to get the collision to work as expected when the interpolate behaviour is used

1 - is to create an invisible mask actor and apply the overlaps and collide with rule to it.
2 - is to change the order of the actors in the layers if the BlackHole actor is above the Sheep actors all works as expected if it is at the bottom of the layer it does not work.

I am seeking some clarification. I would like to verify if this is a bug or expected behaviour when interpolate behaviour is applied to an actor. If it is expected behaviour then why does it work when I change the layer order of the actor? If it turns out to be a bug I will submit a bug report.

Thank you for your help in advance.

Please find the project file with the mask actor workaround attached:

If you delete the mask actor then change the collide rule found in the sheep actor you will be able to see the issue.

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Interpolating overrides physics, so physics won't work when an actor is interpolating.
    It's always been this way.

    Mental Donkey Games
    Website - Facebook - Twitter

  • neomanneoman Member, BASIC Posts: 826
    edited August 2015

    @NipaDidIt said:
    Interpolating overrides physics, so physics won't work when an actor is interpolating.
    It's always been this way.

    Cheers for the reply and the clarification. I thought that might have been the case but when I changed the order of the actors and it worked as expected that got me thinking why would it work if the order of the actors change?

  • ArmellineArmelline Member, PRO Posts: 5,368
    edited August 2015

    Your problem isn't the interpolate. Your problem is interpolate on the black hole AND constrains on the sheep to allow you to drag them. Both interpolate and the constrain attributes override physics.

    You can override physics on one actor, but not on both if you want collisions to still register.

    What you need to do is to look up the tutorial on how to drag actors using linear velocity instead of using constrain attributes. It's called something like "Drag actors and maintain collisions" or something.

    Once you remove the physics override from the sheep, your collisions will be correctly registered.

    Cheers for the reply and the clarification. I thought that might have been the case but when I changed the order of the actors and it worked as expected that got me thinking why would it work if the order of the actors change?

    My assumption would be that when you re-ordered the actors, you change the order GameSalad processes them. So when you drag a sheep, the sheep's position in relation to the black hole is processed before the interpolation of the black hole each frame. The bottom-most actor will be processed before the one above it, etc.

  • neomanneoman Member, BASIC Posts: 826
    edited August 2015

    Cheers for the explanation @Armelline! That makes perfect sense. I had a look around but couldn't find the tutorial you mentioned but you have pointed me in the right direction. I will figure out how to implement drag using linear velocity instead of using constrain attributes ... I guess there is always more than one way to skin a cat ... :wink:

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    I think this is the one that @Armelline was talking about. It's a free template at Gshelper.com

    gshelper.com/shop/free-templates-and-tutorials/constrain-to-mouse-and-keep-collision-gamesalad/

    Mental Donkey Games
    Website - Facebook - Twitter

  • neomanneoman Member, BASIC Posts: 826

    @NipaDidIt said:
    I think this is the one that Armelline was talking about. It's a free template at Gshelper.com

    Thanks for that. I will be sure to check it out!

Sign In or Register to comment.