# SetActorLocation not updating collisions for UInstancedStaticMeshComponent?

**URL:** <https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505>\
**Category:** World Creation\
**Tags:** actor-location, unreal-engine, Instanced-Mesh, Collision, question\
**Created:** [April 18, 2015, 9:13am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505 "2015-04-18T09:13:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [April 18, 2015, 9:13am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/1 "2015-04-18T09:13:41Z")

</div>

Hey everyone,

I am trying to teleport an actor containing only a scene (root component) and UInstancedStaticMeshComponent.

When using the SetActorLocation on this actor, the visible part is moved, but not the collision part.

To illustrate the problem, i used this scenario to obtain the following picture.

- create a 3D map on the right
- throw some dice on the map
- move the map on the left with SetActorLocation(NewLocation)

 ![39218-instancedmeshcollissionproblem.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/7/6/d761cf912c78e23fdf80269edc03d6197350b385.png)

Every part of the 3D map on the left is an instanced static mesh component.

As you can see, the map seems to have been moved, but the collisions remain on the right.

If i throw some new dice on the left, they go through the visible map like it’s not there.

So i am in the current situation:

- new location: visible actor but no collisions
- old location: invisible actor with collisions

It all happens on the server, so in principle it’s not a replication problem.

Any idea how i can fix that ?

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [May 1, 2015, 7:04am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/2 "2015-05-01T07:04:06Z")

</div>

I am having the same problem. Using Blueprint for me, but when I change the transforms of the parent component, the meshes move but the collisions of the original room remain the same. Thus the new room has no collision and the previous place has invisible walls. Bug??

Edit: [This](https://www.youtube.com/watch?v=s41jaNwkBBA) is exactly my problem. When applying a transformation in a constructor the collision doesn’t change, and this video is from April 2014.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [May 10, 2015, 6:08pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/3 "2015-05-10T18:08:22Z")

</div>

Hey !

Little up, any idea anyone ?

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [May 17, 2015, 5:44am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/4 "2015-05-17T05:44:43Z")

</div>

Up Anyone ?

---

<div class="post-metadata">

**Author:** ![kamrann](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@kamrann](https://forums.unrealengine.com/u/kamrann)\
**Post date:** [May 17, 2015, 11:35am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/5 "2015-05-17T11:35:57Z")

</div>

I had the same issue the one time I tried to use an instanced static mesh component, it wasn’t anything important so I just changed my approach in the end. I’d suggest reposting this in the Bug Reports section, it should get some more attention there.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [May 17, 2015, 5:47pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/6 "2015-05-17T17:47:07Z")

</div>

Ok, anyone reading this, i did post a duplicate question in the bug section (not knowing how to change the section for this one^^):

> **[SetActorLocation not updating collisions for UInstancedStaticMeshComponent?](https://forums.unrealengine.com/questions/229242/setactorlocation-not-updating-collisions-for-uinst-1.html)**
>
> Hey everyone, This is a duplicate of the question asked here which didn’t get any answer while it seems to be a real problem: It looks like other people had the same problem, so i’m trying the bug section here. I am trying to teleport an actor...

Cheers

Cedric

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [May 17, 2015, 11:20pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/7 "2015-05-17T23:20:47Z")

</div>

uced, To get around this problem, I just moved the object to where I needed it, then spawned a new object there (with its collision) and deleted the old one with the wrong collision. I do this EVERY TIME I need to move it. It’s a crap solution but with no response from Epic, that’s all I’ve got. There is a bug report on this exact problem from like year ago (see my previous post) and it seems like they haven’t done anything.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [May 18, 2015, 5:03pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/8 "2015-05-18T17:03:32Z")

</div>

Hey HuntaKiller,

Yeah, this is what i do too, but my objects are quite heavy to respawn (this is why i use instanced meshes, i guess you too), thanks anyway for the tip, as you said, better than nothing.

They just closed the duplicate i opened in the bug section because it’s a duplicate^^

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [May 21, 2015, 6:14am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/9 "2015-05-21T06:14:15Z")

</div>

Gareth Martin [has confirmed](https://answers.unrealengine.com/questions/219662/problems-using-1-landscape-to-cast-shadow-onto-ano.html) that this bug has been reported, but unfortunately has not been fixed in 4.8. He says the bug has been marked as high priority and should be fixed in 4.9. For now just use the workaround.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [May 21, 2015, 8:20am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/10 "2015-05-21T08:20:30Z")

</div>

All right, thank you very much for the info.

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [January 20, 2016, 6:57am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/11 "2016-01-20T06:57:52Z")

</div>

I can confirm this bug is still present in 4.9.2, and is occurring with regular static mesh components as well, not just instanced meshes.For such a serious bug I’m surprised it’s still around. Is it addressed in V 10 or 11? Oh. As of Dec /15 it is still not addressed [Here](https://answers.unrealengine.com/questions/207258/instanced-static-meshes-in-blueprints-collision-tr.html)

---

<div class="post-metadata">

**Author:** ![MiDri](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MiDri](https://forums.unrealengine.com/u/MiDri)\
**Post date:** [January 20, 2016, 7:26am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/12 "2016-01-20T07:26:59Z")

</div>

Silly question but is the UInstancedStaticMeshComponent set to movable? I ran into an issue like this building my instanced tile system when some of the stuff I was generating in my tile was set to static or stationary.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [January 20, 2016, 4:08pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/13 "2016-01-20T16:08:46Z")

</div>

Hey,

Yes, still present in 4.10, i have opened a new issue that has been confirmed:

> **[Collisions not updated when moving UInstancedStaticMeshComponent](https://forums.unrealengine.com/questions/349464/collisions-not-updated-when-moving-uinstancedstati.html)**
>
> Hey ! It seems that the collisions are not updated when moving an object composed of UInstancedStaticMeshComponent. When moving a static mesh component, the collisions are following the object (objects collisions and mouse hovering). But when...

Cheers

Cedric

---

<div class="post-metadata">

**Author:** ![Yun-Kun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yun-Kun](https://forums.unrealengine.com/u/Yun-Kun)\
**Post date:** [April 11, 2016, 11:30pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/14 "2016-04-11T23:30:10Z")

</div>

Workaround I found: set collision to none in the class settings then enable it when I need.

---

<div class="post-metadata">

**Author:** ![HuntaKiller](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HuntaKiller](https://forums.unrealengine.com/u/HuntaKiller)\
**Post date:** [April 11, 2016, 11:49pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/15 "2016-04-11T23:49:52Z")

</div>

Will test that tonight

---

<div class="post-metadata">

**Author:** ![CosmicDreamStudios](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@CosmicDreamStudios](https://forums.unrealengine.com/u/CosmicDreamStudios)\
**Post date:** [December 27, 2016, 6:25am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/16 "2016-12-27T06:25:46Z")

</div>

I had a problem similar to this when rotating a hism. The collisions would not update. Similar to what Yun-Kun suggested I did a work around where after each adjustment I would set collision to no collision and right after set it to physics and query. Fixed the issue for me.

---

<div class="post-metadata">

**Author:** ![RDaneelOlivaw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDaneelOlivaw](https://forums.unrealengine.com/u/RDaneelOlivaw)\
**Post date:** [March 13, 2017, 6:16pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/17 "2017-03-13T18:16:49Z")

</div>

I tried your solution but when setting to No collision the object starts flying all over the place. How did you set it exactly?

> SetCollisionEnabled(ECollisionEnabled::NoCollision)

I’m with 4.14 and this still happens.

---

<div class="post-metadata">

**Author:** ![Yun-Kun](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Yun-Kun](https://forums.unrealengine.com/u/Yun-Kun)\
**Post date:** [March 13, 2017, 7:11pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/18 "2017-03-13T19:11:28Z")

</div>

If you’re doing this on a physical object, it messes up its velocity and gravity settings I believe. I believe your workaround would be to switch collision response from “Physic Only” to “Both” instead of “Both” to “None” like I suggested.

---

<div class="post-metadata">

**Author:** ![RDaneelOlivaw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDaneelOlivaw](https://forums.unrealengine.com/u/RDaneelOlivaw)\
**Post date:** [March 14, 2017, 5:54pm UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/19 "2017-03-14T17:54:33Z")

</div>

Not worked had no effect. I applied to an “UStaticMeshComponent” object after moving it and some StaticMeshes attached to it.

> MoveComponents()  
> SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);  
> SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);

But nothing happened.  
I was seraching for a way to set it in each of the moved child components individualy, but they are “USceneComponent” which as fas as I know doesnt have a “SetCollisionEnabled”. Does a casting needed?

> auto ChildCompPrimitive = Cast(ChildComp);  
> ChildCompPrimitive-\>SetCollisionEnabled(ECollisionEnabled::PhysicsOnly);  
> ChildCompPrimitive-\>SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);

Nothing happend either.

Also did:

> auto ChildCompPrimitive = Cast(ChildComp);  
> ChildCompPrimitive-\>SetCollisionEnabled(ECollisionEnabled::NoCollision);  
> ChildCompPrimitive-\>SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);

But it just Made some wierd movements.

AnyIdea?

---

<div class="post-metadata">

**Author:** ![RDaneelOlivaw](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDaneelOlivaw](https://forums.unrealengine.com/u/RDaneelOlivaw)\
**Post date:** [March 15, 2017, 10:58am UTC](https://forums.unrealengine.com/t/setactorlocation-not-updating-collisions-for-uinstancedstaticmeshcomponent/315505/20 "2017-03-15T10:58:35Z")

</div>

Ok after some tests this is what it worked for me:

1. Because it was a chain of statichmeshes with PhysicsActor Collision profile in mycase, but only some of them were moved, I wrongly changed only the moving ones. You have to set All of them.

2. I created an “UpdateCollisionsFunction” that runs each time something is moved.

3. Inside of this function you can find this:

> ChangeCollisionType(ECollisionEnabled::NoCollision);  
> ChangeCollisionType(ECollisionEnabled::QueryAndPhysics);

1. Inside this ChangeCollisionType(), I go through all the StaticMeshes and execute:

> USceneComponent\* ChildComp = thecomponentofeachStaticMeshInMyCharacter;

> auto ChildCompPrimitive =Cast(ChildComp);  
> ChildCompPrimitive-\>SetCollisionEnabled(CollisionNewType);

This did the trick. Hope this helps.
