Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "CoreMinimal.h"
- #include "GameFramework/Character.h"
- #include "MainCharacter.generated.h"
- UCLASS()
- class VRET_API AMainCharacter : public ACharacter
- {
- GENERATED_BODY()
- public:
- // Sets default values for this character's properties
- AMainCharacter();
- protected:
- // Called when the game starts or when spawned
- virtual void BeginPlay() override;
- public:
- // Called every frame
- virtual void Tick(float DeltaTime) override;
- // Called to bind functionality to input
- virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
- private:
- UPROPERTY()
- class UCameraComponent * camera;
- UPROPERTY()
- class USceneComponent * VRroot;
- };
- #include "MainCharacter.h"
- #include "Camera/CameraComponent.h"
- #include "MotionControllerComponent.h"
- #include "Runtime/Engine/Classes/Components/StaticMeshComponent.h"
- #include "Runtime/CoreUObject/Public/UObject/ConstructorHelpers.h"
- // Sets default values
- AMainCharacter::AMainCharacter()
- {
- // Set this character to call Tick() every frame. You can turn this off to improve performance if you don't need it.
- PrimaryActorTick.bCanEverTick = true;
- VRroot = CreateDefaultSubobject<USceneComponent>(TEXT("VRroot"));
- VRroot->SetupAttachment(GetRootComponent());
- camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
- camera->SetupAttachment(VRroot);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement