How do i get a thread safe reference to an ActorComponent in AnimInstance? (ThreadSafeUpdateAnimation)

I’m trying to use this:

I need some references to my Custom ActorComponents:
But I’m having some problems:
All I’m trying to do is not thread safe



And I can’t expose a TSharedPtr to BluePrint either

How can I get thread-safe references to my custom ActorComponents In AnimInstace Blueprint?
(My ActorComponents are written in C++)

Thank you so much!!

Getting the reference to the component without warnings.

I did it like this.


UFUNCTION(BlueprintPure, meta = (BlueprintThreadSafe))
static const UWeaponAttacher *GetdWeaponAttacherComponentThreadSafe(const AActor *Owner);

I hope there are not problems… all access to UObjects are “read-only”.

I will continue testing… if I see that there are not problems I will consider the answer valid.

Anyway, if someone who really knows how this works could give their opinion, I would be very grateful…

I’m just experimenting based on test and error (in the absence of examples there is not other option).

Thank you so much!!


UPDATE:


It does work (No crash)… but the performance is not better…

Seems “BlueprintThreadSafeUpdateAnimation” is doing nothing…

Seems it is executing in the Game Thread… it has no sense…