Fix crash when reading object value from BehaviorKnowledgeSelector

#3171
This commit is contained in:
Wojtek Figat
2025-02-12 16:54:33 +01:00
parent 84843f8cbb
commit a982e0a111

View File

@@ -34,7 +34,7 @@ namespace FlaxEngine.Utilities
if (value == null)
return default;
var type = value.GetType();
if (type != typeof(T))
if (type != typeof(T) && !typeof(T).IsAssignableFrom(type))
{
if (typeof(T) == typeof(Vector2))
{