# Setactorlocation thread safety

**URL:** <https://forums.unrealengine.com/t/setactorlocation-thread-safety/399632>\
**Category:** C++\
**Tags:** threads, threading, unreal-engine, question, CPP\
**Created:** [July 4, 2017, 12:33am UTC](https://forums.unrealengine.com/t/setactorlocation-thread-safety/399632 "2017-07-04T00:33:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asdzxcv](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@asdzxcv](https://forums.unrealengine.com/u/asdzxcv)\
**Post date:** [July 4, 2017, 12:33am UTC](https://forums.unrealengine.com/t/setactorlocation-thread-safety/399632/1 "2017-07-04T00:33:12Z")

</div>

Is it safe to call setactorlocation from a thread other than game thread

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [January 20, 2018, 4:43am UTC](https://forums.unrealengine.com/t/setactorlocation-thread-safety/399632/2 "2018-01-20T04:43:55Z")

</div>

By default - No it isn’t.  
However you may tackle with the Actors inner code and add mutexes there to allow a thread safety.

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [April 2, 2018, 3:49am UTC](https://forums.unrealengine.com/t/setactorlocation-thread-safety/399632/3 "2018-04-02T03:49:59Z")

</div>

The best way to do it would be actually to Spawn a Task (on a game thread) where you can set the actor location. And even better is to batch all the Actors and All the locations and set them all in 1 single Task → the set code will ofcourse be on a game thread but all your calculations can be done on worker thread which probably can slightly or even more than slightly improve your performance.
