# Make it impossible to have multiple keyframes on the same frame in the sequencer

**URL:** <https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807>\
**Category:** Feedback & Requests\
**Tags:** unreal-engine\
**Created:** [November 17, 2022, 1:22pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807 "2022-11-17T13:22:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DGruwier](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DGruwier](https://forums.unrealengine.com/u/DGruwier)\
**Post date:** [November 17, 2022, 1:22pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/1 "2022-11-17T13:22:23Z")

</div>

It’s possible to have multiple keyframes on the same track share the same frame in the sequencer timeline. This creates some unexpected situations that can only be fixed by going into the graph editor and finding and deleting the duplicate keyframe.

For example when dragging a keyframe onto another, most other animation software will replace the existing keyframe with the new one. But in UE, both keyframes now exist on the same frame, conflicting with each other.

I’d like to request that when you drag a keyframe onto another keyframe, the new keyframe replaces the old. There might be other situations that create these twin keyframes as well, this feedback goes for those as well.

---

<div class="post-metadata">

**Author:** ![mugenmelon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mugenmelon/32/1035828_2.png) [@mugenmelon](https://forums.unrealengine.com/u/mugenmelon)\
**Post date:** [March 15, 2025, 9:07am UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/2 "2025-03-15T09:07:49Z")

</div>

Reviving this with a possible solution.  
I believe this is either caused by the auto-key feature or when copy-pasting a keyframe over an existing keyframe.

You can simply right-click the _section_ (the blue part) with duplicate keys, then select _Edit → Reduce Keys_ with a specified tolerance:

 ![ReduceKeys](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/e/7/6e78f1b634b0bd4a63bb01a3be11972e385c5696.png)

There’s a few issues here though.

1. In UE5.5 changing the tolerance crashes my editor.
2. It sometimes unexpectedly deletes non-duplicate keyframes, haven’t quite understood how this works yet

Hope this helps someone.

---

<div class="post-metadata">

**Author:** ![mugenmelon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mugenmelon/32/1035828_2.png) [@mugenmelon](https://forums.unrealengine.com/u/mugenmelon)\
**Post date:** [March 16, 2025, 1:35pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/3 "2025-03-16T13:35:26Z")

</div>

I was wrong. The _Reduce keys_ option both in the track section as well as in the CurveEditor only reduce keys based on their _value_ instead of their _time_. So this solution does not work. Turns out there is no built-in way to remove duplicate keys.

So I wrote a small CurveEditorFilter class that seems to do the job.  
**No guarantees that this works flawlessly.**

**CurveEditorTimeReduceFilter.h**

```c++
#pragma once

#include "Filters/CurveEditorFilterBase.h"
#include "CurveEditorTimeReduceFilter.generated.h"

UCLASS(DisplayName="Simplify Time")
class UCurveEditorTimeReduceFilter : public UCurveEditorFilterBase
{
	GENERATED_BODY()

public:
	explicit UCurveEditorTimeReduceFilter();

protected:
	UPROPERTY(EditAnywhere, meta=(Units="s"))
	double Tolerance;

	virtual void ApplyFilter_Impl(TSharedRef<FCurveEditor> InCurveEditor, const TMap<FCurveModelID, FKeyHandleSet>& InKeysToOperateOn, TMap<FCurveModelID, FKeyHandleSet>& OutKeysToSelect) override;
};

```

**CurveEditorTimeReduceFilter.cpp**

```c++
#include "Curve/Filter/CurveEditorTimeReduceFilter.h"

UCurveEditorTimeReduceFilter::UCurveEditorTimeReduceFilter() : Super(), Tolerance(0.01) {}

void UCurveEditorTimeReduceFilter::ApplyFilter_Impl(const TSharedRef<FCurveEditor> InCurveEditor, const TMap<FCurveModelID, FKeyHandleSet>& InKeysToOperateOn, TMap<FCurveModelID, FKeyHandleSet>& OutKeysToSelect)
{
	OutKeysToSelect = InKeysToOperateOn;
	for (const auto& Pair : InKeysToOperateOn)
	{
		const auto CurveId = Pair.Key;
		const auto& KeySet = Pair.Value;
		auto* Curve = InCurveEditor->FindCurve(CurveId);
		if (!Curve || KeySet.Num() <= 1)
		{
			continue;
		}

		const TArray<FKeyHandle> Keys(KeySet.AsArray());
		TArray<FKeyPosition> Positions;
		Positions.SetNum(Keys.Num());
		Curve->GetKeyPositions(Keys, Positions);

		TArray<FKeyHandle> KeysToRemove;
		auto& SelectedKeysInCurve = OutKeysToSelect[CurveId];
		auto LastTime = Positions[0].InputValue;
		for (int32 i = 1; i < Positions.Num(); i++)
		{
			const auto CurrentTime = Positions[i].InputValue;
			if (FMath::IsNearlyEqual(CurrentTime, LastTime, Tolerance))
			{
				KeysToRemove.Add(Keys[i]);
				SelectedKeysInCurve.Remove(Keys[i], ECurvePointType::Key);
			}
			else
			{
				LastTime = CurrentTime;
			}
		}
		if (KeysToRemove.Num() > 0)
		{
			Curve->Modify();
			Curve->RemoveKeys(KeysToRemove);
		}
	}
}

```

Drop these into one of your editor modules and make sure to add a dependency on “CurveEditor” in your build file as well.  
Then select all the keys you want to de-duplicate in the CurveEditor, go to _Filters_ and select the _Simplify Time_ filter. Adjust tolerance as needed and apply.

---

<div class="post-metadata">

**Author:** ![Max.Chen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/max.chen/32/1194502_2.png) [@Max.Chen](https://forums.unrealengine.com/u/Max.Chen)\
**Post date:** [March 20, 2025, 3:30pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/4 "2025-03-20T15:30:59Z")

</div>

> [@mugenmelon](#):
>
> - In UE5.5 changing the tolerance crashes my editor.

Hey, thanks for the post on this crash. It’ll be fixed for 5.6 going forward. The tracking bug is:

> **[The Unreal Engine Issues and Bug Tracker](https://issues.unrealengine.com/issue/UE-257861)**
>
> Welcome to the Unreal Engine Issue and Bug Tracker. You can check the status of an issue and search for existing bugs. See latest bug fixes too.

---

<div class="post-metadata">

**Author:** ![Max.Chen](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/max.chen/32/1194502_2.png) [@Max.Chen](https://forums.unrealengine.com/u/Max.Chen)\
**Post date:** [March 20, 2025, 3:32pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/5 "2025-03-20T15:32:47Z")

</div>

Also, for 5.6, we are making a change so that keys that have the same time will be removed when keys are deselected. Internally, we need to still allow keys to be on the same frame so that you can drag a key past another. But hopefully removing them on deselection will address these issues of having multiple keyframes on the same frame.

---

<div class="post-metadata">

**Author:** ![mugenmelon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mugenmelon/32/1035828_2.png) [@mugenmelon](https://forums.unrealengine.com/u/mugenmelon)\
**Post date:** [March 20, 2025, 5:55pm UTC](https://forums.unrealengine.com/t/make-it-impossible-to-have-multiple-keyframes-on-the-same-frame-in-the-sequencer/692807/6 "2025-03-20T17:55:56Z")

</div>

Perfect! Thanks so much
