How to change the type of rigidbody using script?

Hello, I have a question.

I want to make a toy model that interacts with a ball, but there is a problem.

If I set this block as ‘dynamic’ first, this block disappears when launching this project.

%EC%BA%A1%EC%B2%98

so, I am trying to set this block as ‘static’ and change it from ‘static’ to ‘dynamic’ while launching.

Is it possible to change it during execution using script?

Thanks.

Example: https://playcanvas.com/editor/scene/681593
API: https://developer.playcanvas.com/en/api/pc.RigidBodyComponent.html#type

Press space bar to during runtime to change the rigidbody from static to dynamic.

1 Like