As per my suggestion you have to use Edge Collider 2D here.
For above path you have to create three colliders and using Edge Collider you don’t have worry about curve shapes.
EDIT:
3 Colliders
Outer boundry
Inner circle boundry
Inner square boundry
Ohw its 2d, missed like the first line or something XD I was wondering why you would suggest an edge collider.
What I would do is make an empty game object called (invisible wall) and make some extra game objects as child of that invisible wall game object depending how many colliders I need which are spread out outside the path.
give each child game object a box collider, scale it and place it on the side of the path where you don’t want the car to go.
if you placed the game objects with the colliders all around the path, you should be good to go.
Ohw its 2d, missed like the first line or something XD I was wondering why you would suggest an edge collider.
– ZentiuBased on game type after seeing path image, it become clear that she has to create perfect path otherwise car stuck at edges.
– siddharth33223 colliders means?
– Ekta-Mehta-Dok but how will i create whole outer boundary using edge collider ? I need take num of objects with edge collider. is it so ?
– Ekta-Mehta-DNo single Edge Collider become enough here. You have to first study about this collider type then implement.
– siddharth3322