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

**URL:** <https://forums.unrealengine.com/t/how-do-i-get-a-thread-safe-reference-to-an-actorcomponent-in-animinstance-threadsafeupdateanimation/2218460>\
**Category:** Character & Animation\
**Tags:** unreal-engine, CPP, question, Blueprint\
**Created:** [December 13, 2024, 11:34pm UTC](https://forums.unrealengine.com/t/how-do-i-get-a-thread-safe-reference-to-an-actorcomponent-in-animinstance-threadsafeupdateanimation/2218460 "2024-12-13T23:34:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [December 13, 2024, 11:34pm UTC](https://forums.unrealengine.com/t/how-do-i-get-a-thread-safe-reference-to-an-actorcomponent-in-animinstance-threadsafeupdateanimation/2218460/1 "2024-12-13T23:34:31Z")

</div>

I’m trying to use this:

 ![Captura de pantalla 2024-12-13 230949](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/b/4/2b4a642bd8af5568ef9aaf587e0ad6dfad6fa528.png)

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

 ![Captura de pantalla 2024-12-13 232221](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/c/2/cc29df7ad2f483bbcd2e69622c8dd0be3f0bda6d.png)

* * *

 ![Captura de pantalla 2024-12-14 002423](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/3/4636798d646b4cbfc592c1d5493140b096b90cd9.png)

* * *

And I can’t expose a TSharedPtr to BluePrint either

 ![Captura de pantalla 2024-12-14 003953](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/9/8/b98d2d4e8755923d0370f6b7ff1d9bc556cd308e.png)

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

Thank you so much!!

---

<div class="post-metadata">

**Author:** ![Ivan3z](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ivan3z](https://forums.unrealengine.com/u/Ivan3z)\
**Post date:** [December 14, 2024, 8:04pm UTC](https://forums.unrealengine.com/t/how-do-i-get-a-thread-safe-reference-to-an-actorcomponent-in-animinstance-threadsafeupdateanimation/2218460/2 "2024-12-14T20:04:18Z")

</div>

Getting the reference to the component without warnings.

I did it like this.

```auto

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…

 ![Captura de pantalla 2024-12-14 234534](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/4/d44517c5fa7dc8c82ca007fc345641fb1189423b.png)
