Triggering a Func with clicking actors in EDITOR Viewport

How can i trigger an event with clicking actors in editor?

I managed to do this by clicking from the world outliner, but I want to do it by clicking from the viewport.
If you want to make it from the world outliner, this is how it is done

cpp file

#include "SceneOutliner/Public/SceneOutlinerDelegates.h"
// Write this in EventBeginPlay or in Construction
	SceneOutliner::FSceneOutlinerDelegates::Get().SelectionChanged.AddUObject(this, &AYOURACTOR::YOURFUNCTION);


Build.cs

image