Hey Trying to Spawn an Item at the SceneComponent(“BulletSpawnComponent”) of an actor but the rotation is not working at all?
I have tried a few things and closest I have got is having the Bullet spawn to the bottom left of the gun (No matter what way it is rotated).
I have tried using a FTrasform to get the proper position/rotation but no luck.
Any ideas on how to fix this.
UWorld* const World = GetWorld();
if (World != NULL)
{
// Spawn out projectile at the end of the gun
const FVector SpawnLocation = BulletSpawnPoint->GetComponentLocation();
const FRotator SpawnRotation = BulletSpawnPoint->GetComponentRotation();
ASPBullet* SpawnedBullet = World->SpawnActor<ASPBullet>(WhatToSpawn, SpawnLocation, SpawnRotation);
FVector BulletDirection = GetGunDirection();
if (SpawnedBullet)
{
SpawnedBullet->FireBullet(BulletDirection);
}
}