I’ve got two different projects both of them have projectiles that come out of a gun. I’ve tried via code as well as BP including even copy and pasting the BP Nodes between projects, and In the first project projectiles come out of the gun as expected move in the correct direction etc. In the second projects they just fall from the gun with no velocity? I’ve checked to see if any of the physics settings are different, and can’t see anything different. Any Ideas?
AActor* bullet = GetWorld()->SpawnActor(mBullet, spawnLocation, rotation);
TArray<UStaticMeshComponent*> component;
bullet->GetComponents(component);
if (component.Num() > 0)
{
FVector force = (component[0]->GetForwardVector() * 5000.0f);
component[0]->AddImpulse(force);
}
Thanks,
Rich.