TangibleCharacter can now be loaded and moved

This commit is contained in:
2024-01-30 13:06:10 -05:00
parent 951daad635
commit 622c2a2486
3 changed files with 7 additions and 4 deletions

Binary file not shown.

View File

@@ -22,6 +22,7 @@ void UlxTangible::Init(UlxTangibleManager* tm, int64 id)
TangibleId = id;
}
#pragma optimize("", off)
void UlxTangible::SetActorBlueprint(const FString &name) {
// If we're already of the right class, do nothing.
if (ActorBlueprintName == name) {
@@ -63,7 +64,9 @@ void UlxTangible::SetActorBlueprint(const FString &name) {
FVector location(0, 0, 0);
FRotator rotation(0, 0, 0);
UWorld* w = Manager->GetWorld();
params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
AActor* a = w->SpawnActor(blueprint, &location, &rotation, params);
check(a != nullptr);
// Insert a TangibleComponent into the actor.
UActorComponent* ac = a->AddComponentByClass(UlxTangibleComponent::StaticClass(), false, FTransform::Identity, false);