Warn if value is the wrong type for the animation graph parameter trying to be set.

This commit is contained in:
Chandler Cox
2025-01-07 20:26:25 -06:00
parent 3133ebbd83
commit 13863344d2

View File

@@ -292,7 +292,11 @@ void AnimatedModel::SetParameterValue(const StringView& name, const Variant& val
{ {
if (param.Name == name) if (param.Name == name)
{ {
param.Value = value; if (Variant::CanCast(value, param.Value.Type))
param.Value = value;
else
LOG(Warning, "Animation Graph parameter '{0}' in AnimatedModel {1} is type '{2}' and not type '{3}'.", String(name), ToString(), param.Value.Type, value.Type);
return; return;
} }
} }