Tunneling even with CCD enabled

MikePL80

  • Posts: 45
Hello..

I've made a small game for my kids to play on where leaves fall and you collect them in a bucket.

The bucket is controlled by a multi touch drag event with no restriction on speed so obviously the quicker you move your thumb the more leaves you can collect.

The problem I'm having is if you move the bucket quickly to a side while a leaf is inside it can go through the wall on the bucket (through its collision area) before the leaf has been killed off by the updating method making the game useless if played quickly.

Enabling continuous collisions had no affect and I think maybe the bucket is able to move quicker than the updating method amd it cant keep up.

Is there anyway round this as it would be a shame to give the bucket movement a maximum speed.

Thanks in advance

Mike

letmethink

  • *
  • Posts: 2545
Are you setting the x of the bucket? If you do that the bucket won't collide with anything.
~Letmethink

yoplalala

  • *
  • Posts: 1611
sliding won't take account of the collisions

MikePL80

  • Posts: 45
I am setting the x of the bucket to match where my thumb is located on the screen and it is colliding with the leaves perfectly when moving slowly, Landing on the rim, hitting it's walls and killing off the leaf when it's inside.

I'm currently using regions to kill off the leaf actor and it works perfectly and has time to kill the actor when you drag the bucket at a medium pace but if you move the bucket quickly then the leaf can tunnel through the collision area of the sides of the bucket before the updating method has had a chance to kill the actor.

I have also tried using an event of detecting the exact location  of x and y of the leaf compared to the bucket and again it works perfectly when going at a slow to medium pace but the collision  areas fail when moving the bucket actor quickly.

Is there a quicker event I don't know about that I can use to kill the leaf actor the as soon as it enters the region as the when updating event seems to take half a second to react. I need it to be instantaneous.

Thanks

« Last Edit: September 18, 2015, 02:47:44 pm by MikePL80 »

MikePL80

  • Posts: 45
The problem is that I can move the bucket away from the leaf actor quicker than the when updating event can kill the actor and with tunneling being an issue it's breaking through the collision zones and then it's obviously then left the region I have set to kill it off.

The game works perfectly if you don't move the bucket too fast when there is a leaf inside it for the spilt second its waiting to be removed from the scene but where's the fun in that? lol

« Last Edit: September 18, 2015, 02:49:45 pm by MikePL80 »

TheIndieStation

  • *
  • Posts: 2263
use the slide block and do it like this:
slide bucket to x of touch over 0 seconds.

MikePL80

  • Posts: 45
I just tried changing my

set x of actor to x of touch
to
slide actor to x of touch over 0 seconds

like you suggested and it hasn't made a difference to the collision problem.
The movement of the bucket still works perfectly as it did the first method but it appears to still be too quick for the game to respond when moved very quickly with your thumb and it doesn't have time to kill off the actor in the bucket before you have moved the bucket away.

If only I could stop the leaf from tunneling through the actor Collision zones it would be trapped in there for the fraction of a second it needs to kill the actor off.

« Last Edit: September 18, 2015, 03:30:27 pm by MikePL80 »

MikePL80

  • Posts: 45
To add the collision zones work perfectly also if you don't move the bucket actor to quickly.

MikePL80

  • Posts: 45
I've just discovered that if I set a collision method for the two actors colliding that this kills the actor instantly and there is no delay like there is when using a always updating method.

Any explanation for why these update at different rates?

I can't set this for my bucket and leaves as they would be also killed by the outside of the bucket. What I am going to try is a another hidden actor inside the bucket to collide with and kill the leaves. Although it seems a bit of a messy work around when the enter region event should be killing the actors instantly rather than waiting a fraction of a second yo do so.

Thanks

MikePL80

  • Posts: 45
That didn't work as now I can slide onto a falling leaf and it can break through the outside of the bucket if I'm moving quickly and get inside through the bucket wall lol

I'm out of ideas now :(

TheIndieStation

  • *
  • Posts: 2263
Can you show us some screenshots of your behavior and physics settings of your actors (bucket and leafs)

MikePL80

  • Posts: 45
Here's my behavior and physics settings

Thank you :)

MikePL80

  • Posts: 45
Also my collisions for the actors

TheIndieStation

  • *
  • Posts: 2263
Change the collision for your leaf to a circle =)

MikePL80

  • Posts: 45
Just tried changing it to a circle but it's still tunneling :(

The collisions are working as they should at slow speeds just not with quick movements?