Minor - Mushroom/Projectile interaction
Ok, le reste de la fonction ne marchait pas à cause d'un BlockAll qui s'était infiltré dans le code du Mushroom Je vais passer à l'interaction avec le centipede
This commit is contained in:
@@ -33,7 +33,7 @@ AM4_Mushroom::AM4_Mushroom()
|
||||
GetStaticMeshComponent()->SetRelativeScale3D(FVector(1.f, 0.45f, 0.20f));
|
||||
|
||||
// Set collision profile to block all
|
||||
GetStaticMeshComponent()->SetCollisionProfileName(TEXT("BlockAll"));
|
||||
GetStaticMeshComponent()->SetCollisionProfileName(TEXT("OverlapAll"));
|
||||
|
||||
}
|
||||
|
||||
@@ -46,12 +46,15 @@ void AM4_Mushroom::BeginPlay()
|
||||
|
||||
void AM4_Mushroom::OnHit(UPrimitiveComponent* HitComp,AActor* OtherActor,UPrimitiveComponent* OtherComp,FVector NormalImpulse,const FHitResult& Hit)
|
||||
{
|
||||
// check if the other actor is a projectile
|
||||
|
||||
AM4_Projectile* Projectile = Cast<AM4_Projectile>(OtherActor);
|
||||
if (!Projectile)
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (DestructionHit++ == MushLife)
|
||||
Destroy();
|
||||
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ AM4_Projectile::AM4_Projectile()
|
||||
}
|
||||
|
||||
ProjectileMeshComponent->SetMaterial(0, ProjectileMat);
|
||||
ProjectileMeshComponent->SetRelativeScale3D(FVector(.8f, .3f, .35f));
|
||||
ProjectileMeshComponent->SetRelativeScale3D(FVector(.3f, .3f, .35f));
|
||||
ProjectileMeshComponent->SetMobility(EComponentMobility::Movable);
|
||||
ProjectileMeshComponent->SetRelativeLocation(FVector::ZeroVector);
|
||||
|
||||
@@ -82,7 +82,6 @@ void AM4_Projectile::FireInDir(const FVector& ShootDir)
|
||||
{
|
||||
SetActorLocation(InitialLoc);
|
||||
ProjectileMovementComponent->Velocity.Z = -1 * ((ShootDir.Z + 380.f) * ProjectileMovementComponent->InitialSpeed);
|
||||
// ProjectileMovementComponent->Velocity.Y = InitialLoc.Y;
|
||||
ProjectileMovementComponent->Velocity.X = 0.f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user