Announcement

Collapse
No announcement yet.

Procedural mesh component events not work

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Procedural mesh component events not work

    Hello.
    I trying add OnBeginCursorOver event to actor with procedural mesh component. I do not know how add it to actor but find how do it for actor component.
    Code:
    MyActor.cpp
    Code:
    ...
    AMyActor::AMyActor()
    {
            ...
    	RootComponent = CreateDefaultSubobject<USphereComponent>(TEXT("RootComponent"));
    
    	GenMesh = CreateDefaultSubobject<UProceduralMeshComponent>(TEXT("GeneratedMesh"));
    	GenMesh->SetMobility(EComponentMobility::Movable);
    
    	Material = UMaterial::GetDefaultMaterial(MD_Surface);
    
    	PrimaryActorTick.bCanEverTick = true;
    
    	FbxManager *manager = FbxManager::Create();
    
            //Parsing geometry
            ...
    
    	GenMesh->CreateMeshSection(0, vertices, Triangles, normals, UV0, vertexColors, tangents, false);
    	GenMesh->OnBeginCursorOver.AddDynamic(this, &AMyActor::OnHover); // Not Work :(
    	GenMesh->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepRelativeTransform);
    }
    
    void AMyActor::OnHover(class UPrimitiveComponent* OtherComp) {
    	UE_LOG(LogTemp, Warning, TEXT("Hover"));
    }
    
    .h
    ...
    UFUNCTION()
    	void OnHover(class UPrimitiveComponent* OtherComp);
    ...
    After run project actor spawning on scene but console not show message after cursor hovering spawned actor.
    Please tell me where is my mistake?

    Edit:
    Click image for larger version

Name:	bp.jpg
Views:	1
Size:	185.9 KB
ID:	1204680
    This Blueprint show true.
    Last edited by AinTen; 12-28-2016, 01:39 PM. Reason: Add data
Working...
X