4.0.6 GraphUpdateScene minBoundsHeight

Upgrading from 3.8.6 to 4.0.6. I have some objects with a GraphUpdateScene component on them with a collider that will have a bounds.size.y of 0. In GraphUpdateScene::GetBounds() I see that the applying of minBoundsHeight is now under the legacyMode bool.

In GridGenerator::UpdateArea under //Apply GUO it specifically checks for o.bounds.Contains((Vector3)node.position). This now results in my object’s not modifying the nodes.

Is GraphUpdateScene no longer responsible for applying a minBoundsHeight? I see that it will pass minBoundsHeight into its GraphUpdateShape constructor however its a direct bounds check to actually apply it to any nodes.

Thanks.

Hi

The previous mode lead to some confusion as the GraphUpdateScene component wouldn’t always use the actual bounds of the collider. So for the 4.0 update I changed it so that when a collider is attached it will no longer show the ‘Min Bounds Height’ in the inspector and instead just use the collider bounds directly.

Does this breaks some common use case for you?

It does. At least common in the sense of our project. We generate terrain as well as water. The mesh that we generate for the water has a bounds.size.y of 0. In this case we add a boxcollider and assign the collider the mesh bound’s center and size. Then we also add a GraphUpdateScene component to tag the nodes as water.

Now I can provide this adjustment myself, everywhere that I intend to use a collider with a GraphUpdateScene. In that case however the grid graph does use the water object’s layer for height detection. I would need to ensure that the collider bounds.size.y is not at 0 for the node detection but that the height is the same as it would be at 0. If not, then boats would be pathing above the water instead of on it.

I am curious of the case you describe though. If someone wants to use the actual collider with a bounds.size.y of 0, wouldn’t the result be that no nodes would be updated? I am surprised someone would actually want that functionality.

If there is a reason why someone would want that, perhaps a bool to toggle applying the min regardless of collider, point, renderer, etc. would be the most flexible way to provide the needs of both parties?

Hi

You make a good point I will see if I can find a way to design the interface to make it work better for all.

I mean that they have (for some reason, or by just using the default value) set the min bounds height to some positive value, and then when they try to use it with a collider that has a height that is smaller than the minBoundsHeight (but not necessarily zero) they are confused as to why it doesn’t seem to respect the collider bounds. It is primarily about reducing confusion, not about features.