# How to avoid invoking property update callback function when a property is changed in the editor until the slider is released

**URL:** <https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [December 5, 2017, 6:12am UTC](https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415 "2017-12-05T06:12:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2ff4858](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2ff4858](https://forums.unrealengine.com/u/anonymous_user_b2ff4858)\
**Post date:** [December 5, 2017, 6:12am UTC](https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415/1 "2017-12-05T06:12:48Z")

</div>

I have a class UMyClass derived from UObject, and a property inside this class, e.g.

```
class ENGINE_API UMyClass : public UObject
{
public:
    UPROPERTY(EditAnywhere, Category = Parameters)
	float Property;
    ...
}

```

Plus, the function that uses these properties is included in

```
void UStaticMesh::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
   ...
   Function(Property);
   ...
}

```

By default, `Function(Property) ` will be called lots of times using UE4 slider to tweak Property. However, `Function() `in our case is quite expensive, so we want to avoid calling it several times. Instead, we would like to avoid calling `Function(Property)` until the slider is released.

Is there a flag for `UPROPERTY` to do this? Or any other solutions?

Thanks.

Cheers,

---

<div class="post-metadata">

**Author:** ![rXp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rXp](https://forums.unrealengine.com/u/rXp)\
**Post date:** [December 5, 2017, 12:38pm UTC](https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415/2 "2017-12-05T12:38:12Z")

</div>

I would guess you would need to only update it when OnControllerCaptureEnd or OnMouseCaptureEnd is triggered :

> **[USlider](https://docs.unrealengine.com/4.27/en-US/API/Runtime/UMG/Components/USlider/)**
>
> A simple widget that shows a sliding bar with a handle that allows you to control the value between 0..1.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b2ff4858](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b2ff4858](https://forums.unrealengine.com/u/anonymous_user_b2ff4858)\
**Post date:** [December 6, 2017, 7:34am UTC](https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415/3 "2017-12-06T07:34:19Z")

</div>

Thanks for the links.

I was thinking maybe there is an option in UPROPERTY flags/meta data that can be used to indicate this kind of usage. But it turned out there is no such flag. As for OnMouseCaptureEnd, I don’t see any function calls regarding to it in my case.

Any more details or suggestions?

---

<div class="post-metadata">

**Author:** ![rXp](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rXp](https://forums.unrealengine.com/u/rXp)\
**Post date:** [December 6, 2017, 7:04pm UTC](https://forums.unrealengine.com/t/how-to-avoid-invoking-property-update-callback-function-when-a-property-is-changed-in-the-editor-until-the-slider-is-released/411415/4 "2017-12-06T19:04:59Z")

</div>

I see 3 solutions for you :

1. Go through the user widget tree to find your USlider widget and then use `USlider->OnMouseCaptureEnd.AddDynamic(this, &MyListenerClass::OnMouseCaptureEndHandler);`  
[A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Simple_Global_Event_System#Listening_To_Events_From_Code)

2. It would be better to first create/spawn the USlider widget from your c++ class with `MySlider = CreateWidget<USlider>(MyPlayerController, ParentWidget);` and then simply use the solution in 1 `USlider->OnMouseCaptureEnd.AddDynamic(this, &MyListenerClass::OnMouseCaptureEndHandler);`  
[https://docs.unrealengine.com/latest/INT/API/Runtime/UMG/Blueprint/CreateWidget/1/](https://docs.unrealengine.com/latest/INT/API/Runtime/UMG/Blueprint/CreateWidget/1/)

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

1. If you want total control over this slider you can inherit it.  
Look at the class [USlider | Unreal Engine Documentation](https://docs.unrealengine.com/latest/INT/API/Runtime/UMG/Components/USlider/)  
And you can then just expose the event to blueprint and do even more 🙂
