PhysBone freezes if parents scale is zero on enable then become non-zero, and isAnimated is set to false.
tracked
anatawa12
PhysBone freezes if parents scale is zero on enable then become non-zero, and isAnimated is set to false.
Summary
A PhysBone will become frozen (does not sway and unable to grab) if the all of the following conditions are met:
- The parent of the PhysBone has a scale of zero when the PhysBone become enabled, and then scale is set to non-zero.
- The Is Animatedoption is set to false.
Details
First of all, The documentation of PhysBone does not mention that PhysBone will freeze in some cases.
Therefore, freezing is not expected behavior (for us).
Secondly, the documentation of
Is Animated
option says:> Allows bone transforms to be animated. Each frame bone rest position will be updated according to what was animated. This must be enabled in order for any bone in the PhysBone chain (Root bone included!) to respect animations applied to it.
Therefore, there is no mention for parent scale or any other behavior related to
Is Animated
flag, and there is no mention for freezing.If both or either of the behaviors are expected, please update the documentation to mention that.
Steps to reproduce
this gist is a minimal assets to reproduce the issue.
Download the zip and unzip it to anywhere in Assets, then open the
Test Scene.unity
.You'll see single Avatar with a PhysBone with Is Animated set to false under "Parent" GameObject, and an "Indicator" that shows the "Angle" Animator Parameter of the PhysBone.
- Set the "Is Animated" of the PhysBone to false.
- Select the "Parent" GameObject and set the scale to (0, 0, 0), and make it inactive (uncheck the checkbox).
- Enter Play Mode.
- Activate the "Parent" GameObject. (This will also make the PhysBone enable)
- Set the scale of "Parent" to (1, 1, 1).
- Problem 1: The "Angle" parameter of the PhysBone become 0.5 and will not change.
- Problem 2: When you try to grab the PhysBone on the scene view, it will not able to grab.
When you set the "Is Animated" to true, both problem will not happen.
When you enabled the PhysBone after setting scale to 1,1,1 (swapping step 4 and 5), both problem will not happen.
Log In
StormRel
tracked