Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #include "MyProject.h"
- #include "MyActor.h"
- // Sets default values
- AMyActor::AMyActor(const FObjectInitializer& ObjectInitializer)
- : Super(ObjectInitializer)
- {
- // Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- PrimaryActorTick.bCanEverTick = true;
- Attributes = ObjectInitializer.CreateDefaultSubobject<UMyActorComponent>(this, TEXT("Attributes"));
- }
- // Called when the game starts or when spawned
- void AMyActor::BeginPlay()
- {
- Super::BeginPlay();
- }
- // Called every frame
- void AMyActor::Tick( float DeltaTime )
- {
- Super::Tick( DeltaTime );
- GEngine->AddOnScreenDebugMessage(-1, 3.f, FColor::Red, FString::Printf(TEXT("%f"), Attributes->Health));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement