Hello
I have a function in the code with this body:
if (DoesSocketExist(MuzzleSocketName))
{
const FVector StartVector (GetSocketLocation(MuzzleSocketName));
const FQuat StartRotation (GetSocketRotation(MuzzleSocketName));
const FVector StartScale (1, 1, 1);
FTransform NewTransf (StartRotation, StartVector, StartScale);
/** Projectile Spawning */
auto SpawnedProjectile = GetWorld()->SpawnActorDeferred<ABaseProjectile>(ProjectileClass, NewTransf, GetOwner(), nullptr, ESpawnActorCollisionHandlingMethod::AlwaysSpawn);
if (SpawnedProjectile)
{
/** Projectile Speed is relying on Construction Script. This will force to use it */
SpawnedProjectile->FinishSpawning(SpawnTransform);
if (MuzzleFlashParticleSystem)
{
SpawnTransform.SetScale3D(MuzzleFlashParticleSystemScale);
UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), MuzzleFlashParticleSystem, SpawnTransform);
}
OnWeaponFired.Broadcast(GetOwner(), SpawnedProjectile);
}
The question is - how I need to change Vector, Rotation and Scale in FTransform to change spawn characteristics of projectile? I mean, change direction (I want to projectile to miss, to go on wrong direction) when he is spawning. I tried to sum to vectors and FQuat different random parametrs, but it hadnt any effect.