# SetActorLocation not working after toggling Simulate Physics

**URL:** <https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [July 10, 2017, 10:56am UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924 "2017-07-10T10:56:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thaun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thaun](https://forums.unrealengine.com/u/Thaun)\
**Post date:** [July 10, 2017, 10:56am UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924/1 "2017-07-10T10:56:05Z")

</div>

Im having some issues trying to move the object that has physics. Turning physics off makes the script work. But when i turn it on, it wont move/teleport where i want it to be.

So i have disabled physics at first, then reenable it with script, and disable it again, and that makes it not work again.

![202089-1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/a/8/3a83a391202f75a7cfcefa1628c2d1552f10995a.png)

By not changing the physics settings at all and keeping it off, makes it work. But from Enabled Physics to Disabled Physics does not work.

Here is a video of how it should work and what the problem is: [- YouTube](https://youtu.be/x1SBMmLGogc)

Also, this script is in the player script.

Also, SetActorLocation does not work when Physics is already activated. Disabling Physics with script when Physics is default activated makes also SetActorLocation not work.

If Physics is already default deactivated, and remove Set Simulate Physics (true), it will work.

---

<div class="post-metadata">

**Author:** ![AmphDev](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AmphDev](https://forums.unrealengine.com/u/AmphDev)\
**Post date:** [July 10, 2017, 11:19am UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924/2 "2017-07-10T11:19:56Z")

</div>

Hey, im not sure this is bug 🙂

Two possible options:

One:

Your game is multiplayer game and runned with more client, in this case physics and physics simulated movement will be not replicated because engine can replicate simulated meshes if static mesh component are set as root of the actor!!! 🙂

Two:

Im not sure, but physics simulated actors accepting mostly forces and direct setting location maybe ignored (im not sure about this)

But no worrie!!

Any case you have solution.

You need work with physics constraint actor/component!!  
This is a simple actor ehich can tie and connect together two other actor/mesh and allowing swing/twist movement.  
If base actor is not simulating physics, tied other actor will not fall to the ground, just swinging.

Short prof:  
Constraint component to char, if interact happen attach interacted mesh to your constraint component, and mesh will follow your character 🙂  
And dont forget to set mesh as root in that interactable actor, just for sure.

Some further info:

> **[Physics Constraint Component User Guide](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Constraints/ConstraintsBlueprints/)**
>
> A user guide on using the Physics Constraint Component in Blueprints.

> **[Constraints User Guide](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Physics/Constraints/ConstraintsUserGuide/)**
>
> Physical joints used to connect two rigid body simulated objects together.

Or and i totally forgot about this:

**Ue have built in Physical Handle solution** for this 🙂

> **[Physics Handle](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Physics/Components/PhysicsHandle/)**
>
> Physics Handle

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

<div class="post-metadata">

**Author:** ![Thaun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Thaun](https://forums.unrealengine.com/u/Thaun)\
**Post date:** [July 10, 2017, 11:58am UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924/3 "2017-07-10T11:58:02Z")

</div>

So, what i just did is putting Static Mesh Component as root. And changed the blueprint a bit, and it worked as intended. Thanks for that.

 ![202091-2.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/1/0/a10aa672c4d06ef97ca0dbeaae1132055bc2e3a0.png)

---

<div class="post-metadata">

**Author:** ![LXFrontier](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LXFrontier](https://forums.unrealengine.com/u/LXFrontier)\
**Post date:** [August 6, 2019, 10:33pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924/4 "2019-08-06T22:33:33Z")

</div>

Enabling Teleport or setting the teleport type in cpp fixes this for me.

---

<div class="post-metadata">

**Author:** ![Tasty\_Snak](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/tasty_snak/32/550507_2.png) [@Tasty\_Snak](https://forums.unrealengine.com/u/Tasty_Snak)\
**Post date:** [March 31, 2022, 4:41am UTC](https://forums.unrealengine.com/t/setactorlocation-not-working-after-toggling-simulate-physics/399924/5 "2022-03-31T04:41:59Z")

</div>

This was bugging me for half a day! Changing the collision to be the child of the mesh worked for me. Cheers!
