#Update collider properties

1 messages · Page 1 of 1 (latest)

cosmic sentinel
#

Is there any way to update collider at runtime?


    protected override void OnCreate()
    {
        Collider = Unity.Physics.CapsuleCollider.Create(new CapsuleGeometry()
        {
            Radius = 5.0f,
            Vertex0 = 0.0f,
            Vertex1 = 100.0f
        });```

i have this code.

Can i update collider from anoter CapsuleGeometry at runtime?
idle cave
#

yeah you can totally update colliders at runtime

#

just note by default during baking colliders of the same type will point to the same memory

#

so if you modify 1 entity it will modify all entities

#

so yeah you need to replace it like your above code