SpriteShape gets drawn only after switching to Scene View, or not at all

Hello!

I’ve created a ‘rope system’ which creates a visualization of a rope physics through Sprite Shape by using small 2d boxes as the points which conform the Spline of the Sprite Shape.

The problem is that sometimes the Sprite Shape only shows up after switching to the Scene View, then when you switch back to the Game View the Sprite Shape gets drawn correctly.

However, this problem only occurs when a sprite shape is created with certain angle offset between the attached bodies.

I’ve thought about it being about the distance of the points, but currently I’m using a method which assures a minimum distance is kept between all spline’s points.

The code used to create the spline can be seen over here.

If someone knows how could I replicate the switch to the Scene View with code in order to force fix this issue, I’d appreciate it very much.

Edit: This problem is currently happening, without any kind of debug error/warning, on Unity 2020.3.18f1, using the latest SpriteShape version available. Tried to check if this problem persists with Unity 2021, and on this version the SpriteShape doesn’t get drawn even if a switch to the Scene View is made.

I’ve recorded a brief video showing the problem, but in this case, even switching to the Scene View won’t make it appear:

The configuration of the sprite being used is the following one:

Solved: Problem seems to occur because there seem to exist certain bound limits of how much the SpriteShape’s container can extend.

The solution applied here was to move the SpriteShape’s transform to the position of one of the attached bodies.

Although, it’d be nice if a method like ‘LimitBounds’, ‘RecalculateBounds’, or something like that could be called in order to limit the SpriteShape’s transform to the current Spline.