Which header file would we add this change? Would it be the Turret.h one or some other header file? This is regarding the reply you made to Freedom911.
Announcement
Collapse
No announcement yet.
Training Stream - Tanks vs. Zombies, p.3 - May 17th
Collapse
X
-
I have strange error after editing top of Tank.h it is sometimes fixable by:
https://answers.unrealengine.com/que...***-error.html
but sometimes this solution do not workand I have to try random combination of it to work. Can anyone help?
Comment
-
Thanks for the tutorial, I know I am really late to the party but I'm hoping someone can still remember and help me get through my bottleneck. I am struggling to spawn a shell. In particular I can't figure out where the shell sprite was added.
On the video at 1:14 there doesn't seem to be any shell sprite in the blueprint but I have downloaded the C++ code and it is not in the Missile class either? I tried to add one in the construction script of RegularMissileBP and a few other things but none have worked.
Also at 1:14 there is a paper flipbook. I can make the flipbook but if I right click on the Blueprint then the only flipbook node available is AddPaperFlibookComponent. There is no SetFlipbook etc.
Thanks!Announce Post: https://forums.unrealengine.com/showthread.php?110887 Continuing the "Tanks" C++ stream, Richard and Lauren are making tanks to fight a zombie...
Comment
-
I've been following this series on Youtube (using 4.18.2) and have encountered a scenario I can't quite figure out yet.
It seems my Projectile check is always returning negative and hence my UE_LOG for the fire event isn't firing.
My turret.h contains the following:Code:protected: // Maximum turn rate in degrees/second for the turret. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Turret") float YawSpeed; // Tank that owns this turret. UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Turret") ATank* Tank; // Projectile to spawn when firing. UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Turret") TSubclassOf<AActor> Projectile;
Code:const FTankInput& CurrentInput = Tank->GetCurrentInput(); if (CurrentInput.bFire1) { UE_LOG(LogTemp, Warning, TEXT("FIRE! 1")); } if (CurrentInput.bFire1 && Projectile) { UE_LOG(LogTemp, Warning, TEXT("FIRE! 2")); if (UWorld* World = GetWorld()) { UE_LOG(LogTemp, Warning, TEXT("FIRE! 3")); if (AActor* NewProjectile = World->SpawnActor(Projectile)) { FVector Loc = TurretSprite->GetSocketLocation("Muzzle"); FRotator Rot = TurretDirection->GetComponentRotation(); NewProjectile->SetActorLocation(Loc); NewProjectile->SetActorRotation(Rot); } } }
Comment
Comment