detomon / wigglebone

Adds jiggle physics to bones of a Skeleton
Other
296 stars 11 forks source link

Godot 4.1.3: The variable type is being inferred from a Variant value #6

Closed lleblanc42 closed 7 months ago

lleblanc42 commented 7 months ago

Godot version

v4.1.3.stable

Issue description

Recieved a parse error in the console upon importing the plugin into Godot 4.1.3 that reads, "The variable type is being inferred from a Variant value, so it will be typed as Variant". This happens on line 252 in wiggle_bone.gd. Basically Godot doesn't know how to type cast it. To fix, simply apply the type.

var h := max(0.0, k - abs(a - b))

to

var h: float = max(0.0, k - abs(a - b))

Steps to reproduce

Import the plugin into 4.1.3.

detomon commented 7 months ago

Strangely, I couldn't reproduce this error in any Godot version. Though, I once got it too on another occasion. I'll push a new version which should prevent this in any case. Thanks!