My custom actor (containing a few custom UMeshComponent) does not update when I change its location or the visibility of its components.
I instantiate it this way in StartPlay()
of my GameMode class:
MyCustomActor = GetWorld()->SpawnActor<AMyCustomActor>(AMyCustomActor::StaticClass());
Then I set its new location like this:
MyCustomActor->SetActorLocation(FVector(100,0,0));
Is it because I did not set the Owner? Or what is wrong?
Note
I don't understand why, but my code works now... It might be linked to those warnings:
LogActor:Warning: GameSession /Game/PersistentLevel.GameSession_19 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
and
LogActor:Warning: Natively added component (MyCustomActor_143.RootComponent) was left unattached from the actor's root.
AMyCustomActor
. You shouldn't need to specify an Owner to move an actor about. \$\endgroup\$ – T. Kiley Sep 15 '15 at 21:24LogActor:Warning: GameSession /Game/UEDPIE_0_ProBuilderLevel.ProBuilderLevel:PersistentLevel.GameSession_19 has natively added scene component(s), but none of them were set as the actor's RootComponent - picking one arbitrarily
andLogActor:Warning: Natively added component (Gizmo_143.RootComponent) was left unattached from the actor's root.
\$\endgroup\$ – arthur.sw Sep 16 '15 at 10:51RootComponent
. I guess you used to be using an older version of Unreal which was silently failing, but now it is randomly choosing one of your components to be the root. (I didn't know they'd fixed that - I used to get caught out by this all the time!) \$\endgroup\$ – T. Kiley Sep 16 '15 at 12:47