Search Issue Tracker

Fixed

Fixed in 1.7.7

Votes

0

Found in [Package]

1.7.6

Issue ID

UVSB-2105

Regression

No

Unity.VisualScripting.ConversionUtility.TryConvert<T> always returns false

Package: Visual Scripting

-

Unity.VisualScripting.ConversionUtility.TryConvert<T>, even in the success branch, returns false. The method never seems to be able to return true. Note: the non-generic version, TryConvert(object value, ...) behaves correctly.

*Steps to Reproduce:*
1. Create a new script
2. Add the following code (roughly)
{code:java}
[UnityEditor.MenuItem("")]
public static void Test() {
bool success = Unity.VisualScripting.ConversionUtility.TryConvert<int>(3, out int result, guaranteed: true);
Debug.Log($"Expected: 3, true - Was: {result}, {success}");
}
{code}
3. Run the test from the menu.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.