This recipe shows you how to create a placeable pickup that will respawn after a certain amount of time, suitable as an ammo or other pickup for a First Person Shooter (FPS).
Creating a respawning pickup for a First Person Shooter
How to do it...
- Create a new Actor class called Pickup:
- Declare the following delegate type in Pickup.h:
DECLARE_DELEGATE(FPickedupEventSignature)
- Add the following properties to the class header:
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "GameFramework/RotatingMovementComponent.h"
#include "Pickup.generated.h"
DECLARE_DELEGATE(FPickedupEventSignature...