Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

generatedbody Error

Hey Guys Can You Help Me, I am having a problem with C++ Coding (Generated body) Code : // Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.

 #pragma once
 #include "CoreMinimal.h"
 #include "GameFramework/Actor.h"
 #include "PatlamaEfektiProjectile.generated.h"
 class UParticalSystem;
 class APatlamaEfektiProjectile : public AActor
     /** Sphere collision component */
     UPROPERTY(VisibleDefaultsOnly, Category=Projectile)
     class USphereComponent* CollisionComp;
     /** Projectile movement component */
     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Movement, meta = (AllowPrivateAccess = "true"))
     class UProjectileMovementComponent* ProjectileMovement;
     UPROPERTY(EditDefaultsOnly, Category = "FX")
     UParticalSystem* ExplosionEffect;
     /** called when projectile hits something */
     void OnHit(UPrimitiveComponent* HitComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
     /** Returns CollisionComp subobject **/
     FORCEINLINE class USphereComponent* GetCollisionComp() const { return CollisionComp; }
     /** Returns ProjectileMovement subobject **/
     FORCEINLINE class UProjectileMovementComponent* GetProjectileMovement() const { return ProjectileMovement; }

Other Code (I having Problem With Spawn Emitter):

 // Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
 #include "PatlamaEfektiProjectile.h"
 #include "GameFramework/ProjectileMovementComponent.h"
 #include "Components/SphereComponent.h"
 #include "Kismet/GameplayStatics.h"
     // Use a sphere as a simple collision representation
     CollisionComp = CreateDefaultSubobject<USphereComponent>(TEXT("SphereComp"));
     CollisionComp->OnComponentHit.AddDynamic(this, &APatlamaEfektiProjectile::OnHit);        // set up a notification for when this component hits something blocking
     // Players can't walk on it
     CollisionComp->SetWalkableSlopeOverride(FWalkableSlopeOverride(WalkableSlope_Unwalkable, 0.f));
     CollisionComp->CanCharacterStepUpOn = ECB_No;
     // Set as root component
     RootComponent = CollisionComp;
     // Use a ProjectileMovementComponent to govern this projectile's movement
     ProjectileMovement = CreateDefaultSubobject<UProjectileMovementComponent>(TEXT("ProjectileComp"));
     ProjectileMovement->UpdatedComponent = CollisionComp;
     ProjectileMovement->InitialSpeed = 3000.f;
     ProjectileMovement->MaxSpeed = 3000.f;
     ProjectileMovement->bRotationFollowsVelocity = true;
     ProjectileMovement->bShouldBounce = true;
     // Die after 3 seconds by default
     InitialLifeSpan = 3.0f;
 void APatlamaEfektiProjectile::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 != NULL) && (OtherActor != this) && (OtherComp != NULL) && OtherComp->IsSimulatingPhysics())
         OtherComp->AddImpulseAtLocation(GetVelocity() * 100.0f, GetActorLocation());
     UGameplayStatics::SpawnEmitterAtLocation(GetWorld(), ExplosionEffect, GetActorLocation());

Product Version: UE 4.19
more ▼

asked Sep 07 '18 at 08:52 AM in C++ Programming

avatar image


(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question