# Is this a bug?

**URL:** <https://forums.unrealengine.com/t/is-this-a-bug/303151>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [January 6, 2015, 6:32am UTC](https://forums.unrealengine.com/t/is-this-a-bug/303151 "2015-01-06T06:32:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1e743dad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1e743dad](https://forums.unrealengine.com/u/anonymous_user_1e743dad)\
**Post date:** [January 6, 2015, 6:32am UTC](https://forums.unrealengine.com/t/is-this-a-bug/303151/1 "2015-01-06T06:32:22Z")

</div>

Hello. I have an actor class called ship. I added a UStaticMesh component from code to it. Then created a blueprint. But with the UStaticMesh added from code the actor doesn’t respond to SetActorLocation()  
But, if I remove the UStaticMesh component from code and add it directly on the blueprint it works like it should.

Is this a bug?

Code:

```
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Static Mesh")
UStaticMeshComponent *Mesh;
...
Mesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("ShipMesh"));
Mesh->AttachParent = RootComponent;

```

**Mesh component added from code:**

 ![25754-fromcode.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/f/acfb82d210457fe37f310a72ea191240c8ba9f65.jpeg)

**Mesh component added directly on blueprint(removed the UStaticMesh from code):**

 ![25755-addedonblueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/a/20a17efad62fac886959bc0a751f47a0355f98e2.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1e743dad](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1e743dad](https://forums.unrealengine.com/u/anonymous_user_1e743dad)\
**Post date:** [January 6, 2015, 7:10am UTC](https://forums.unrealengine.com/t/is-this-a-bug/303151/2 "2015-01-06T07:10:45Z")

</div>

Set UStaticMeshComponent as root. Now it works
