Hai there,
I’ve been struggling with an issue that I cannot seem to solve on my own.
I was experimenting with shape components and something strange is happening.
I have this member “m_box_extend” and I’ve initialized it to 20,20,20 in the constructor of my component.
I’ve created the member in the header like this:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "TestProject")
FVector m_box_extend;
Now when I want to update this property and have a visual representation in the editor there is this method you need to override aswel which I did and looks like this:
void UBoxTriggerComponent::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
{
Super::PostEditChangeProperty(PropertyChangedEvent);
FName property_name = (PropertyChangedEvent.MemberProperty != NULL)
? PropertyChangedEvent.MemberProperty->GetFName()
: NAME_None;
if ((property_name == GET_MEMBER_NAME_CHECKED(UBoxTriggerComponent, m_box_extend)))
{
m_trigger->SetBoxExtent(m_box_extend);
}
}
So far so good if I execute this code and update "m_box_extends " in the blueprint details panel of my component the box is actually updated.
The problem is that when I press " Compile " inside the blueprint the visualization that represents this " Box " will reset to the initialize 20,20,20 that I’ve set in the constructor although the values in the details panel do stay the same.
So somewhere in the render code of that " Box " he will use the inital values instead of the adjusted values I suppose. Is there somewhere I can adjust this?
Or is there something else I’m missing?
Kind Regards,
Dyronix