Hello, I have a character and a movement component. Using delegates I would like the movement component to call a function on the character, but I just can’t get it working.
Try this out real quick change MovementComponent->MovementUpdated.AddDynamic(this, &AUnit::UnitMovementUpdated); to just MovementUpdated.AddDynamic(this, &AUnit::UnitMovementUpdated);
This doesn’t work because MovementUpdated doesn’t exist in the class, it exists in the MovementComponent class.
Yes, it makes no difference.
This is strange because I’ve used things like
FootCollider->OnComponentBeginOverlap.AddDynamic(this, &AHero::FootOverlap);
(FootCollider is a USphereComponent component)
and it works just fine, but I can’t get my own custom one to trigger.
Edit: I tried setting it to UPROPERTY(BlueprintAssignable) FMovementUpdated MovementUpdated;
but that didn’t help. I looked at how OnComponentBeginOverlap is setup and used in UPrimitiveComponent, and my setup looks identical, so I really have no ideas here.