Pins Shaking

cud_s08_counting_upright_objects

#1

There was a discussion posted on here before that had the same problem but was closed. I tried what they suggested but still my pins shake. The position of the pins rapidly change and then stop after a certain point. Has anyone experienced this? I just can’t get it to work and it’s been frustrating me. Below are the components I have for a bowling pin:

image

image

image

Am I missing something?


#2

I too am having this issue and was hoping it would be explained by the end of the section, but it was not. I think we could put a cut off timer in there where if it takes longer than 10 seconds to decide how many are standing it just moves on, but that wouldn’t be as accurate.


#3

This video explains what happens:

basically, the pins are always falling down, a possible fix for that is to reduce the Physics sleep threshold in the Physics manager:
https://docs.unity3d.com/Manual/class-PhysicsManager.html


#4

I tried reducing the Physics sleep threshold and also the bouncing threshold but still the pins shake. Does anyone have a unity package (that is running as should) I can import so I can compare what is going on with my project?

In the mean time, I may have to work around it with something like Benjamin posted.


#5

How about changing the collision detection mode from the pins to continuous and set the floor to static?


#6

I changed the pins to continuous detection mode and it still shakes. How do I set the floor to static? From what I understand, mesh colliders without a rigidbody are static, and the floor doesn’t have a mesh collider. This is what I have set for my floor:

The method IsStanding will alternate between true and false (more so false) but will always end up returning false. This happens because the pin’s position and rotation is constantly moving, hence the shaking of the pin. I can’t find a way to stop the pins from shaking.


#7

Sorry, I can’t think of other reason for it to be wobbling, perhaps you could try one more thing, put a empty gameobject in the scene and make everything child of it, and then set it’s scale to 0.01 in every axis and then unchild everything again. This should divide the scale of everything by 100.

Static colliders are the ones that don’t have a rigidbody or that is market as static in the top of the inspector


#8

I created a parent object and made all objects in the scene a child of it. I then set each axis scale to 0.01 and unchilded each object but still the pins wobble. I honestly don’t know what is going on. I moved onto the TileVania section of this course for the meantime. Thanks for helping me with this weird bug in my project, I really appreciate it.


#9

Have you tried to adjust the y coordinates for the renew pins method?
Instantiate(PinSet, new Vector3(0, 1.1f, 18.29f), Quaternion.identity)
It took a while to get it right but that solved the wobbling issue. I am using 1 world unit = 1 meter. I am not sure if that makes a difference with your game. You can try to adjust the time when the pins are lowered in the animation. I have it set at 10 secs. If I tried it sooner or later the pins did wobble. I see that your rigidbody collision detection is set to discrete try using continuous dynamic. I am also using a physics material on the bowling lane.