sbox-issues
sbox-issues copied to clipboard
`MorphCollection.Set` restricted in [0,1] range
Describe the bug
Hi,
I'm trying to set my morph to a value below 0 or above 1, but it doesn't apply in the game. Lets jump to the reproduction steps
To Reproduce
- Use a model with Morphs
- Set its morph to a value greater than 1f:
SkinnedModelRenderer.SceneModel.Morphs.Set( "my_morph", 100f );
or to a negative value :
SkinnedModelRenderer.SceneModel.Morphs.Set( "my_morph", -1f );
- Print the returned value :
Log.Info( "my_morph " + SkinnedModelRenderer.SceneModel.Morphs.Get( "my_morph" ) );
This will print "100" for the positive value and "0" for the negative value.
Additionally, even though the 100 weight is printed, the Morph behaves the same as if the value were set to 1f.
Expected behavior
Set()
in https://sbox.game/api/Sandbox.MorphCollection/Set should not be restricted to the [0;1] range
Media/Files
Positive value:
Negative value:
Additional context
No response