Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include "CoreMinimal.h"
  4. #include "GameFramework/Character.h"
  5. #include "MainCharacter.generated.h"
  6.  
  7. UCLASS()
  8. class VRET_API AMainCharacter : public ACharacter
  9. {
  10. GENERATED_BODY()
  11.  
  12. public:
  13. // Sets default values for this character's properties
  14. AMainCharacter();
  15.  
  16.  
  17. protected:
  18. // Called when the game starts or when spawned
  19. virtual void BeginPlay() override;
  20.  
  21. public:
  22. // Called every frame
  23. virtual void Tick(float DeltaTime) override;
  24.  
  25. // Called to bind functionality to input
  26. virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
  27.  
  28. private:
  29. UPROPERTY()
  30. class UCameraComponent * camera;
  31. UPROPERTY()
  32. class USceneComponent * VRroot;
  33. };
  34.  
  35. #include "MainCharacter.h"
  36. #include "Camera/CameraComponent.h"
  37. #include "MotionControllerComponent.h"
  38. #include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
  39. #include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
  40.  
  41. // Sets default values
  42. AMainCharacter::AMainCharacter()
  43. {
  44.  
  45. // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
  46. PrimaryActorTick.bCanEverTick = true;
  47. VRroot = CreateDefaultSubobject<USceneComponent>(TEXT("VRroot"));
  48. VRroot->SetupAttachment(GetRootComponent());
  49. camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
  50. camera->SetupAttachment(VRroot);
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement