SetRigidBodyType2DThe action allows you to change the
body type and
simulated parameters in a Rigidbody 2D (I was surprised that no acion exists, or I overlooked it).
PurposeI needed the action because I have physics objects in the scene that are tempoarily bound to the character, for which these parameters need to be changed temporarily. But it's probably an esoteric need.
Small CaveatIn a perfect action, the
body type drop down's default would be "don't change". However, it's populated by Unity enums and I don't know how to add a nice extra option in there. However, that's cosmetics.
My simple workaround is a bool that asks if you want to leave
body type alone, and only change the
simulated property (which was what I needed in the end). Perhaps a more elegant way would be to split the action into two, for each separate setting.
I also read in documentation that these changes are best in FixedUpdate. But when I plug them there, they show no effect. It's now a standard OnEnter affair, and works.
As UsualAnyone can of course use this and modify it. Someone with access can also upload it to Ecosystem, too (though beware, I am not a coder, please doublecheck).