I’m currently trying to make a gun and when it shoots something a bullet hole decal will spawn where the raycast hit. I managed to get the decal to spawn and all that but now I’m facing an issue where the decal is facing a weird way depending on the angle I shoot the wall. I’d ideally just like to have the decal face flat along the wall.
Here’s a video of what I’m talking about
I want the decals to look flat along the walls like this though:
oh and the sonic picture is just a placeholder for the bullet decal (havent found a good bullet decal yet)
here’s the code I have to spawn the decal
cpp:
void AFPS_Character::SpawnShell(FVector Loc, FRotator Rot)
{
FActorSpawnParameters SpawnParams;
AActor* SpawnActorRef = GetWorld()->SpawnActor<AActor>(ActorToSpawn, Loc, Rot, SpawnParams);
}
const FRotator Rot = Camera->GetComponentRotation();
SpawnShell(HitResult->Location, Rot);
header:
UPROPERTY(EditDefaultsOnly, Category = "Spawning")
TSubclassOf<AActor> ActorToSpawn;