// Fill out your copyright notice in the Description page of Project Settings. #include "OpenDoor.h" #include "GameFramework/Actor.h" // Sets default values for this component's properties UOpenDoor::UOpenDoor() { // Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features // off to improve performance if you don't need them. PrimaryComponentTick.bCanEverTick = true; // ... } // Called when the game starts void UOpenDoor::BeginPlay() { Super::BeginPlay(); // ... //得到所在Actor 设置这个Actor的属性 AActor* Actor = GetOwner(); // pick =y yaw = z roll= x FRotator NewRotator = FRotator(90, 0, 0); Actor->SetActorRotation(NewRotator); } // Called every frame void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { Super::TickComponent(DeltaTime, TickType, ThisTickFunction); // ... }