Moving a UStaticMeshComponent with code.
Hello, for the past few days I am struggling with this coding problem.
I have an actor class named Item from which I made a blueprint. The blueprint consists of a USphereComponent which is the RootComponent and a UStaticMeshComponent which is parented to the USphereComponent.
I store these items in a TArray to prototype an inventory idea. If I move my cursor over the item, it saves a reference to the item in my inventory TArray. Now what I am trying to do is when pressing a key, the first item in that TArray appears where my mouse cursor is.
It does move the RootComponent, but the UStaticMeshComponent does not want to move. The following image shows the 2 marked lines where I am trying to move the actor in code. The first one works which moves the RootComponent. The second won't work.
I hope that someone would know why the mesh won't move.
asked Aug 28 '14 at 12:34 AM in C++ Programming
Set Mobility Movable
you have to specifically tell Static Mesh Components that they can move!
This is set to static by default for lighting optimization reasons
answered Aug 28 '14 at 06:59 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here