Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include "SpellWorld.h"
#include "RandomProjectile.h"
ARandomProjectile::ARandomProjectile(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
int min = 1;
int max = 5;
int randNum = rand() % max + min;
int randNum2 = rand() % 10000 + 10;
this->SetScale(FVector(randNum, randNum, randNum));
this->SetSpeed(randNum2);
//this->SetLifeSpan(randNum);
}
#pragma once
#include "SpellWorldProjectile.h"
#include "RandomProjectile.generated.h"
UCLASS(config = Game)
class ARandomProjectile : public ASpellWorldProjectile
{
public:
GENERATED_BODY()
//Constructor
ARandomProjectile(const FObjectInitializer& ObjectInitializer);
////Called when projectile hits something
//UFUNCTION()
//void OnHit(AActor* otherActor, UPrimitiveComponent* otherComp, FVector normalImpulse, const FHitResult& hit);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.