Hey! I started working with C++ and had a small problem with my variables. They show up in the player’s blue print, but I can’t actually modify any of the variables. Anyone know why?
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "InstinctCharacter.generated.h"
UCLASS(config=Game)
class AInstinctCharacter : public ACharacter
{
GENERATED_UCLASS_BODY()
/** Pawn mesh: 1st person view (arms; seen only by self) */
UPROPERTY(VisibleDefaultsOnly, Category=Mesh)
TSubobjectPtr<class USkeletalMeshComponent> Mesh1P;
/** First person camera */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
TSubobjectPtr<class UCameraComponent> FirstPersonCameraComponent;
/** Base turn rate, in deg/sec. Other scaling may affect final turn rate. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
float BaseTurnRate;
/** Base look up/down rate, in deg/sec. Other scaling may affect final rate. */
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category=Camera)
float BaseLookUpRate;
/** Gun muzzle's offset from the characters location */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
FVector GunOffset;
/** Projectile class to spawn */
UPROPERTY(EditDefaultsOnly, Category=Projectile)
TSubclassOf<class AInstinctProjectile> ProjectileClass;
/** Sound to play each time we fire */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Gameplay)
USoundBase* FireSound;
/** AnimMontage to play each time we fire */
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
UAnimMontage* FireAnimation;
//Player health
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Health)
INT64 plHealth;
//Max Player health
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Health)
INT64 plMaxHealth;
//Initial Health
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Health)
INT64 plInitHealth;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Weapon)
INT64 wpAmmo;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Weapon)
INT64 wpInitAmmo;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite, Category = Weapon)
INT64 wpMaxAmmo;
UFUNCTION()
void dealDamage(INT64 Damage);
virtual void BeginPlay() OVERRIDE;
protected:
/** Handler for a touch input beginning. */
void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location);
/** Fires a projectile. */
void OnFire();
/** Handles moving forward/backward */
void MoveForward(float Val);
/** Handles stafing movement, left and right */
void MoveRight(float Val);
/**
* Called via input to turn at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
*/
void TurnAtRate(float Rate);
/**
* Called via input to turn look up/down at a given rate.
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
*/
void LookUpAtRate(float Rate);
protected:
// APawn interface
virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) OVERRIDE;
// End of APawn interface
};
Thank you in advance!
Edit: Posted the whole header code due to a request.
Below: This is what I get in Blueprint. I can see it, but I cannot modify it.