I want to apply physics. Do you have any recommendations?

Avatar
  • updated

I want to Use Physics with your Shapes Plugin.

Will Unity Collider 2D work?

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
Freya Holmér creator

sure! you can use whatever physics you want, Shapes is just a rendering library, and can be applied on top of whatever you're using

Avatar
김홀 (Whiny)
Quote from Freya Holmér

sure! you can use whatever physics you want, Shapes is just a rendering library, and can be applied on top of whatever you're using

One more Question.

How can I get vertices of shapes?

rex)Regularpolygon can change shapes by sides and I want to get it.

Avatar
Freya Holmér creator

there's no built-in function for it, but it's relatively straightforward to mathematically calculate:

public Vector2 GetVertex( int i ) {
    float ang = i * ShapesMath.TAU / sides + angle;
    return ShapesMath.AngToDir( ang ) * radius;
}