Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FTransform AEBFBaseSpell::GetTransformInCircle(FVector Center, float Radius)
- {
- float Degrees = ((360.f / (float)BaseSpellInfo.NumOfObjectsToSpawn) * (float)NumOfSpawnedObjects);
- float x = Radius * FMath::Sin(FMath::DegreesToRadians(Degrees));
- float y = Radius * FMath::Cos(FMath::DegreesToRadians(Degrees));
- Center.X += x;
- Center.Y += y;
- FRotator Rot = UKismetMathLibrary::FindLookAtRotation(GetActorForwardVector(), GetActorLocation() - Center);
- Rot.Yaw -= 90.f;
- FQuat FinalRotation = FQuat(Rot);
- FTransform FinalTransform = FTransform();
- FinalTransform.SetLocation(Center);
- FinalTransform.SetRotation(FinalRotation);
- return FinalTransform;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement