How to prevent bouncing when boxcollider size changes very quickly?

Hi, I have a animated boxCollider. When it change its size very fast it bounce on the floor.

I triyed to put it a material with friction=0 and Bounciness=0 (the same for the tilemap) but is doest’n works.

I need that it not bounce becouse it change my isJumping and my isGroundted variables.

Some idea to get it? Thank you so much!!

Given your brief description only, I’d say it’s not bouncing, you’re causing overlaps so the solver has to move it out of overlap. Imagine a box on the ground that instantly gets bigger (not physical reality of course). What should happen? Maybe the box has to move upwards to come out of the ground.

If you’re going to instantly change the geometry of colliders then you need to understand the consequences of causing overlaps. This is no different (say) then instantly positioning a collider into an overlap and then letting the physics solver try to figure it out. In your case it sounds like your simply enlarging it but it amounts to the same thing; overlap to be solved.

1 Like

Thank You so much for your response!! Ok, i understand it. So, any way to avoid overlaps? I mean, some configuration of something like that to do it possible?

Well you’re causing the overlap by increasing the size of the box so the only answers is don’t increase the size of them.

1 Like

Ok, i think i’ll would have to live with overlaps then… thank you so much

I guess the question is, if you enlarge a box sitting on the ground, what would you expect to happen? I mean, overlaps happen all the time with colliders but they typically overlap a small amount and the solver separates them. If you force a large overlap, it’ll separate it but it’s not bouncing.

I mean I’d like to help but I’m not sure how else to advise you here, sorry. :slight_smile:

1 Like

Sorry, I just read your answer.

For me, the ideal is for the collider to increase in size perfectly supported on the ground (delicately).

In my case the problem occurs when my character is crouched and stands up. In this case, the collider overlaps the ground and is propelled upward.

Another case is when my character is going to jump and shrink his legs to gain momentum. In this case, the character is suspended in the air instead of resting on the ground, and since it is not in contact with the tilemap, it is perceived as a jump.

I think ideally the tilemap would be perfectly rigid like the real floor. And that my character could not fly unless a force or a speed is applied on the vertical axis.

Sorry for my delay in replying and thank you very much for his reply.

Maybe you should provide a video of that happening because overlap solving might produce small overshoots but the whole point of it is that it doesn’t Your description sounds like it goes flying into the air which doesn’t sound like overlap solving/overshoot and maybe that’s related to other physics settings you’ve made such as very large gravity, scale or some global settings.

Hi, I´m sorry about my delay, i was very busy the last days. I made the video that you ask me. It is in the following link…

https://www.youtube.com/watch?v=wmLLGqrCqNQ

I really would like the BoxCollider won’t fly and wont overlapping with the floor.

Thank you so much

i found this!!

is it good or bad solution?