From 13863344d26f90b041ac4c4fbb172ab443bfa322 Mon Sep 17 00:00:00 2001 From: Chandler Cox Date: Tue, 7 Jan 2025 20:26:25 -0600 Subject: [PATCH] Warn if value is the wrong type for the animation graph parameter trying to be set. --- Source/Engine/Level/Actors/AnimatedModel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Level/Actors/AnimatedModel.cpp b/Source/Engine/Level/Actors/AnimatedModel.cpp index b09b76394..3d27dc9e8 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.cpp +++ b/Source/Engine/Level/Actors/AnimatedModel.cpp @@ -292,7 +292,11 @@ void AnimatedModel::SetParameterValue(const StringView& name, const Variant& val { 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; } }