First of all, im really confused right now.
I have setup some 3D Widget Interaction stuff. my PlayerController has a WidgetInteraction Component tracing the Mouseposition and everything works fine.
WidgetInteraction = CreateDefaultSubobject<UWidgetInteractionComponent>(TEXT("WidgetInteraction"));
WidgetInteraction->SetupAttachment(GetRootComponent());
WidgetInteraction->TraceChannel = COLLISION_WIDGETACTOR; //yes i use some custom trace for this.
WidgetInteraction->InteractionDistance = 3000.0f;
WidgetInteraction->InteractionSource = EWidgetInteractionSource::Mouse;
WidgetInteraction->bShowDebug = true;
I can Click a 3D Widget Component Button (Created with Blueprint) and it calls all Onclick Events like it should. Everything is fine.
Now the problem (and the problem seems kind of weird):
My Custom GameState has the following line to replicate a Variable.
void AGameController::GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{
//Super::GetLifetimeReplicatedProps(OutLifetimeProps); // This causes the error?!
DOREPLIFETIME(AGameController, RoundTimeLeft);
}
So if if add that Line “Super::GetLifetimeReplicatedProps(OutLifetimeProps);” the Widget Interaction stops working. When I click on a Widget Button now, the Pressed Animation of the Button is played, but the OnClick Event isnt fired. (Same behavior if i outcomment the whole replication block and dont define “GetLifetimeReplicatedProps”.)
So my questions are:
What does the GameState have to do with this?
Is this a somehow known behavior?
Is this a bug?
What can I do to Add the line and still have the widgets working?
I didnt Test this on a blank project yet…
if you need other code or my widget blueprints to answer this i could share them, but i dont think they will help because they do work, just not with that Gamestate replication.
Im using (UE 4.14.2). (And im pretty new to UE)
(To be honest, I dont really expect someone to answer this. I might have to reconstructure my Code so this error bothers me not that much.)