- Home /
Is there a way to create random polygonal sprite in script?
Hello, I'm making 2D game and I have a sprite of the gound. Currently it is just a square, but I want to change the shape of the sprite, so every new game it will have new random shape. Later I'll add PolygonCollider2D to ground object so it will collide with other objects in the scene.
Simple example. Green square - sprite and green lines - PolygonCollider2D
I think I have 2 options: 1. Stretch sprite to fill all PolygonCollider2D area, but I don't know how? 2. Firstly change shape of sprite and then add collider.
Please, I'm new to Unity and I didn't find any similar questions. I'll appreciate any help and suggestions
Your answer
Follow this Question
Related Questions
How to change a 2d sprite to another sprite in an array? 0 Answers
Why wont my sprite renderer show when enabled? 0 Answers
Why does my sprite change size when in game but not when in scene? 0 Answers
Flipping sprite by y axis when rotated past a certain point., 1 Answer
Scale 2d Sprite collider size to UIImage collider size 0 Answers