Hi guys..
Context : I'm messing around, and working towards a FPS (think Unreal Tournament or Battlefield)
I have a WeaponBase class.
I define a struct
Then I define these variables in the same class
I then have a DataTable setup in the engine

on my BP_WeaponBase I set the Weapon Data Table to the above Weapon Data.
(Everyone with me still?)
Then on my Character class, I have the following setup:
So the question is:
Is this right way to do things? Or the preferred way? Or should there be a better tutorial I should be looking at?
Context : I'm messing around, and working towards a FPS (think Unreal Tournament or Battlefield)
I have a WeaponBase class.
I define a struct
Code:
USTRUCT(BlueprintType) struct FWeaponData : public FTableRowBase { GENERATED_USTRUCT_BODY() UPROPERTY(EditAnywhere) class USkeletalMesh* WeaponMesh; UPROPERTY(EditAnywhere) FString WeaponName; };
Code:
class USkeletalMeshComponent* MeshComp; UPROPERTY(EditAnywhere) class UDataTable* WeaponDataTable;
on my BP_WeaponBase I set the Weapon Data Table to the above Weapon Data.
(Everyone with me still?)
Then on my Character class, I have the following setup:
Code:
class AWeaponBase* Weapon; UFUNCTION(BlueprintCallable) void SwitchWeapon(TSubclassOf<class AWeaponBase> WeaponClass);
Is this right way to do things? Or the preferred way? Or should there be a better tutorial I should be looking at?