Advertisement
Guest User

Untitled

a guest
Jun 18th, 2015
600
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.81 KB | None | 0 0
  1. // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3. #include "MyProject.h"
  4. #include "MyActor.h"
  5.  
  6.  
  7. // Sets default values
  8. AMyActor::AMyActor(const FObjectInitializer& ObjectInitializer)
  9. : Super(ObjectInitializer)
  10. {
  11.     // Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
  12.     PrimaryActorTick.bCanEverTick = true;
  13.     Attributes = ObjectInitializer.CreateDefaultSubobject<UMyActorComponent>(this, TEXT("Attributes"));
  14. }
  15.  
  16. // Called when the game starts or when spawned
  17. void AMyActor::BeginPlay()
  18. {
  19.     Super::BeginPlay();
  20.    
  21. }
  22.  
  23. // Called every frame
  24. void AMyActor::Tick( float DeltaTime )
  25. {
  26.     Super::Tick( DeltaTime );
  27.     GEngine->AddOnScreenDebugMessage(-1, 3.f, FColor::Red, FString::Printf(TEXT("%f"), Attributes->Health));
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement