Get property value pointer

I am trying to get a given UObject property value by name using the reflection system. From what I have, I can get the UProperty, and that works great- but i can’t seem to use ContainerPtrToValuePtr to get the actual value. My code-

UStat* UCharacterSheet::GetStatByName(FName stat, UObject* owner)
{
	UProperty* prop = FindField<UProperty>(GetClass(), stat);
	if (prop)
	{
		UStat* value = prop->ContainerPtrToValuePtr<UStat>(owner);
		return value;
	}
	
	return NULL;
}
1 Like