TangibleCharacter can now be loaded and moved
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -22,6 +22,7 @@ void UlxTangible::Init(UlxTangibleManager* tm, int64 id)
|
|||||||
TangibleId = id;
|
TangibleId = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma optimize("", off)
|
||||||
void UlxTangible::SetActorBlueprint(const FString &name) {
|
void UlxTangible::SetActorBlueprint(const FString &name) {
|
||||||
// If we're already of the right class, do nothing.
|
// If we're already of the right class, do nothing.
|
||||||
if (ActorBlueprintName == name) {
|
if (ActorBlueprintName == name) {
|
||||||
@@ -63,7 +64,9 @@ void UlxTangible::SetActorBlueprint(const FString &name) {
|
|||||||
FVector location(0, 0, 0);
|
FVector location(0, 0, 0);
|
||||||
FRotator rotation(0, 0, 0);
|
FRotator rotation(0, 0, 0);
|
||||||
UWorld* w = Manager->GetWorld();
|
UWorld* w = Manager->GetWorld();
|
||||||
|
params.SpawnCollisionHandlingOverride = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||||
AActor* a = w->SpawnActor(blueprint, &location, &rotation, params);
|
AActor* a = w->SpawnActor(blueprint, &location, &rotation, params);
|
||||||
|
check(a != nullptr);
|
||||||
|
|
||||||
// Insert a TangibleComponent into the actor.
|
// Insert a TangibleComponent into the actor.
|
||||||
UActorComponent* ac = a->AddComponentByClass(UlxTangibleComponent::StaticClass(), false, FTransform::Identity, false);
|
UActorComponent* ac = a->AddComponentByClass(UlxTangibleComponent::StaticClass(), false, FTransform::Identity, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user