Existing actors in replayer are positioned to the initial position. (#3328)

This commit is contained in:
Axel1092 2020-09-21 14:42:18 +02:00 committed by GitHub
parent fb96d7f6c7
commit 9586cd24d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -54,6 +54,10 @@ std::pair<int, FActorView>CarlaReplayerHelper::TryToCreateReplayerActor(
if (desc->Id == ActorDesc.Id)
{
// we don't need to create, actor of same type already exist
// relocate
FRotator Rot = FRotator::MakeFromEuler(Rotation);
FTransform Trans2(Rot, Location, FVector(1, 1, 1));
view.GetActor()->SetActorTransform(Trans2, false, nullptr, ETeleportType::TeleportPhysics);
return std::pair<int, FActorView>(2, view);
}
}