BG Spline Colliders

Colliders pack for BGCurve
Unity Asset Store:

Description

Colliders pack consists of 3 components for BG Curve, which generate colliders along Bezier spline.

How it works

BGCcCollider2DEdge - generates points for attached EdgeCollider 2D.
BGCcCollider3DBox - generate a set of children GameObjects with single attached BoxCollider. GameObjects are positioned and rotated properly.
BGCcCollider2DBox - the same as BGCcCollider3DBox, however children GameObjects may have optional Effector2D attached.

Note: for Box Colliders you should not place your own Colliders right under the spline, cause they may be reused and deleted.
Generate a set of   Box colliders   for 3D spline
  • info Create a spline (Video Tutorial)   (Text Guide)
  • info Turn on snapping (Under Points tab) if you need it. Setup "Snap Layer Mask" for collisions.
  • info Add "Collider 3D Box" component (under Components tab). This component reuses 1 level children GameObjects with BoxCollider attached, so do not place any additional BoxColliders under spline's GameObject.
  • info Adjust Resolution. You can adjust the number of points you want to split the spline to by adjusting Math's components properties (if you set SplitMode to 'UseMathData'), or you can change SplitMode to PartsTotal or PartsPerSection and assign the number os splits directly. We recommend to set SplitMode to 'UseMathData' (default) and change MathType of Math component to Adaptive and adjust Tolerance.
  • info Adjust "Collider 3D Box" component properties if needed (like Width, Heigth, OffSet etc.)
Generate a set of   Box Colliders 2D   for 2D spline
  • info Create a spline (Video Tutorial)   (Text Guide)
  • info Set spline's 2D Mode to XY (under Points tab).
  • info Add "Collider 2D Box" component (under Components tab). This component reuses 1 level children GameObjects with BoxCollider2D attached, so do not place any additional BoxCollider2D under spline's GameObject.
  • info Adjust Resolution. You can adjust the number of points you want to split the spline to by adjusting Math's components properties (if you set SplitMode to 'UseMathData'), or you can change SplitMode to PartsTotal or PartsPerSection and assign the number os splits directly. We recommend to set SplitMode to 'UseMathData' (default) and change MathType of Math component to Adaptive and adjust Tolerance.
  • info Adjust "Collider 2D Box" component properties if needed (like Heigth, OffSet etc.)
Generate points positions for   Edge Collider 2D   Unity's Component for 2D spline
  • info Create a spline (Video Tutorial)   (Text Guide)
  • info Set spline's 2D Mode to XY (under Points tab).
  • info Add "Collider 2D Edge" component (under Components tab).