Hi, i am trying to make changes and additions to the ready FPS package to improve myself.
When any cube is damaged i want it to create a Point Light within itself.
The only change i made is this;
//MyProjectProjectile.cpp
void AtrialProjectile::OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
{
// Only add impulse and destroy projectile if we hit a physics
if ((OtherActor != nullptr) && (OtherActor != this) && (OtherComp != nullptr) && OtherComp->IsSimulatingPhysics())
{
// OtherComp->AddImpulseAtLocation(GetVelocity() * 100.0f, GetActorLocation());
class UPointLightComponent* MyLight;
OtherActor->AddComponent(FName("Light"), false, GetTransform(), MyLight);
}
}
Thank you from now