UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Actor.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Stats/Stats.h"
8#include "UObject/Object.h"
9#include "InputCoreTypes.h"
10#include "Templates/Requires.h"
12#include "Engine/EngineTypes.h"
14#include "PropertyPairsMap.h"
16#include "RenderCommandFence.h"
19
20#include <atomic>
21
22#if WITH_EDITOR
23#include "Folder.h"
24#endif
25
27
28#include "Actor.generated.h"
29
30class AActor;
31class AController;
32class APawn;
34class UActorChannel;
35class UChildActorComponent;
36class UNetDriver;
37class UPrimitiveComponent;
38struct FAttachedActorInfo;
39struct FNetViewer;
45class UDataLayerAsset;
47class UDataLayerInstance;
52class UActorFolder;
53struct FActorDataLayer;
54struct FHitResult;
55
56namespace UE::Net
57{
58 class FTearOffSetter;
59 struct FReplicationSystemUtil;
60}
61
62// By default, debug and development builds (even cooked) will keep actor labels. Manually define this if you want to make a local build
63// that keep actor labels for Test or Shipping builds.
64#ifndef ACTOR_HAS_LABELS
65#define ACTOR_HAS_LABELS (UE_BUILD_DEBUG || UE_BUILD_DEVELOPMENT || WITH_PROFILEGPU)
66#endif
67
69UENUM(BlueprintType)
71{
72 // Use the default value specified by the native class or config value.
74 // Always update overlap state on initialization.
76 // Only update if root component has Movable mobility.
78 // Never update overlap state on initialization.
80};
81
83UENUM(BlueprintType)
85{
87 OverrideRootScale UMETA(DisplayName = "Override Root Component Scale"),
89 MultiplyWithRoot UMETA(DisplayName = "Multiply Scale With Root Component Scale"),
91};
92
94UENUM()
102
103UENUM()
114
116
117#if WITH_EDITORONLY_DATA
119UENUM()
121{
122 // Actor uses its bounds to determine in which runtime cells it's going to be placed.
123 Bounds,
124 // Actor uses its location to determine in which runtime cells it's going to be placed.
125 Location,
126 // Actor is always loaded (not placed in the grid), also affects editor.
129};
130#endif
131
134{
135 UE_DEPRECATED(5.6, "Use GetLastRenderTime/SetLastRenderTime instead.")
136 std::atomic<float> LastRenderTime;
137
144
145 float GetLastRenderTime() const
146 {
148 return LastRenderTime.load(std::memory_order_relaxed);
150 }
151
152 std::atomic_int32_t NumAlwaysVisibleComponents = 0;
153
154private:
155 static void Set(AActor* InActor, float LastRenderTime);
157
160};
161
163
164// Delegate signatures
165DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FiveParams( FTakeAnyDamageSignature, AActor, OnTakeAnyDamage, AActor*, DamagedActor, float, Damage, const class UDamageType*, DamageType, class AController*, InstigatedBy, AActor*, DamageCauser );
166DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_NineParams( FTakePointDamageSignature, AActor, OnTakePointDamage, AActor*, DamagedActor, float, Damage, class AController*, InstigatedBy, FVector, HitLocation, class UPrimitiveComponent*, FHitComponent, FName, BoneName, FVector, ShotFromDirection, const class UDamageType*, DamageType, AActor*, DamageCauser );
167DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SevenParams( FTakeRadialDamageSignature, AActor, OnTakeRadialDamage, AActor*, DamagedActor, float, Damage, const class UDamageType*, DamageType, FVector, Origin, const FHitResult&, HitInfo, class AController*, InstigatedBy, AActor*, DamageCauser );
171
180
183
184DECLARE_DELEGATE_SixParams(FMakeNoiseDelegate, AActor*, float /*Loudness*/, class APawn*, const FVector&, float /*MaxRange*/, FName /*Tag*/);
185
186#if WITH_EDITOR
188
191#endif
192
193#if !UE_BUILD_SHIPPING
195#endif
196
201template<class T, uint32 NumElements = NumInlinedActorComponents>
202class TInlineComponentArray : public TArray<T, TInlineAllocator<NumElements>>
203{
205
206public:
209};
210
211template<class T, uint32 NumElements>
213{
214 enum { Value = true };
215};
216
255UCLASS(BlueprintType, Blueprintable, config=Engine, meta=(ShortTooltip="An Actor is an object that can be placed or spawned in the world."), MinimalAPI)
257{
259
260public:
263
266
267private:
269 ENGINE_API void InitializeDefaults();
270
271public:
273 ENGINE_API virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
274
276 ENGINE_API virtual void GetReplicatedCustomConditionState(FCustomPropertyConditionState& OutActiveState) const override;
277
284 UPROPERTY(EditDefaultsOnly, Category=Tick)
285 struct FActorTickFunction PrimaryActorTick;
286
288 UPROPERTY()
289 uint8 bNetTemporary:1;
290
292 uint8 bNetStartup:1;
293
295 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadOnly)
296 uint8 bOnlyRelevantToOwner:1;
297
299 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite)
300 uint8 bAlwaysRelevant:1;
301
303 UFUNCTION()
304 ENGINE_API virtual void OnRep_ReplicateMovement();
305
306#if WITH_EDITOR
307 virtual bool ShouldDuplicateInPIE() const { return !bIgnoreInPIE; }
308#endif
309
310private:
317 UPROPERTY(ReplicatedUsing=OnRep_ReplicateMovement, Category=Replication, EditDefaultsOnly)
318 uint8 bReplicateMovement:1;
319
320 UPROPERTY(EditDefaultsOnly, Category = Replication, AdvancedDisplay)
321 uint8 bCallPreReplication:1;
322
323 UPROPERTY(EditDefaultsOnly, Category = Replication, AdvancedDisplay)
324 uint8 bCallPreReplicationForReplay:1;
325
330 UPROPERTY(Interp, EditAnywhere, Category=Rendering, BlueprintReadOnly, Replicated, meta=(AllowPrivateAccess="true", DisplayName="Actor Hidden In Game", SequencerTrackClass="/Script/MovieSceneTracks.MovieSceneVisibilityTrack"))
331 uint8 bHidden:1;
332
334 uint8 bTearOff:1;
335
336 friend class UE::Net::FTearOffSetter;
337
339 UPROPERTY()
340 uint8 bForceNetAddressable:1;
341
342#if WITH_EDITORONLY_DATA
344 UPROPERTY(Transient, NonTransactional)
346
348 UPROPERTY(Transient, NonTransactional)
350
351 friend struct FSetActorIsInLevelInstance;
352 friend struct FAddActorLevelInstanceFlags;
353 friend struct FRemoveActorLevelInstanceFlags;
354
355public:
356 UPROPERTY(EditAnywhere, AdvancedDisplay, Category = LevelInstance, meta = (Tooltip = "If checked, this Actor will only get loaded in a main world (persistent level), it will not be loaded through Level Instances."))
358
362
363private:
364#endif
365
367 ENGINE_API bool ShouldCallPreReplication() const;
368
370 ENGINE_API bool ShouldCallPreReplicationForReplay() const;
371
372public:
374 ENGINE_API void SetCallPreReplication(bool bCall);
375
377 ENGINE_API void SetCallPreReplicationForReplay(bool bCall);
378
380 bool GetTearOff() const
381 {
382 return bTearOff;
383 }
384
385#if WITH_EDITOR
387 UE_DEPRECATED(5.4, "Call IsInEditLevelInstanceHierarchy/IsInEditLevelInstance instead.")
389 {
390 return IsInEditLevelInstance();
391 }
392
394 bool IsInAnyEditLevelInstance() const
395 {
397 }
398
400 bool IsInEditLevelInstance() const
401 {
403 }
404
407 {
409 }
410
413 {
415 }
416
419 {
421 }
422
425 {
427 }
428
430 bool IsInLevelInstance() const
431 {
433 }
434#endif
435
437 UFUNCTION(BlueprintCallable, Category=Networking)
438 ENGINE_API virtual void TearOff();
439
445 uint8 bExchangedRoles:1;
446
448 UPROPERTY(Category=Replication, EditAnywhere)
449 uint8 bNetLoadOnClient:1;
450
452 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite)
453 uint8 bNetUseOwnerRelevancy:1;
454
456 UPROPERTY()
457 uint8 bRelevantForNetworkReplays:1;
458
463 UPROPERTY(EditAnywhere, Category=Collision, AdvancedDisplay)
464 uint8 bRelevantForLevelBounds:1;
465
471 UPROPERTY(Category=Replication, EditDefaultsOnly, AdvancedDisplay)
472 uint8 bReplayRewindable:1;
473
479 UPROPERTY(EditDefaultsOnly, Category=Tick)
480 uint8 bAllowTickBeforeBeginPlay:1;
481
482private:
484 UPROPERTY(BlueprintSetter=SetAutoDestroyWhenFinished, Category=Actor)
485 uint8 bAutoDestroyWhenFinished:1;
486
492 UPROPERTY(EditAnywhere, BlueprintReadWrite, SaveGame, Replicated, Category=Actor, meta=(AllowPrivateAccess="true"))
493 uint8 bCanBeDamaged:1;
494
495public:
497 UPROPERTY(EditDefaultsOnly, Category=Input)
498 uint8 bBlockInput:1;
499
501 UPROPERTY()
502 uint8 bCollideWhenPlacing:1;
503
505 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Actor, AdvancedDisplay)
506 uint8 bFindCameraComponentWhenViewTarget:1;
507
513 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Collision)
514 uint8 bGenerateOverlapEventsDuringLevelStreaming:1;
515
517 UPROPERTY(EditAnywhere, AdvancedDisplay, Category=Actor)
518 uint8 bIgnoresOriginShifting:1;
519
521 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=HLOD, meta=(DisplayName="Include Actor in HLOD"))
522 uint8 bEnableAutoLODGeneration:1;
523
525 UPROPERTY(EditAnywhere, AdvancedDisplay, Category=Cooking)
526 uint8 bIsEditorOnlyActor:1;
527
529 uint8 bActorSeamlessTraveled:1;
530
536 ENGINE_API virtual bool HasNetOwner() const;
537
543 ENGINE_API virtual bool HasLocalNetOwner() const;
544
545 bool GetAutoDestroyWhenFinished() const { return bAutoDestroyWhenFinished; }
546
547 UFUNCTION(BlueprintSetter)
548 ENGINE_API void SetAutoDestroyWhenFinished(bool bVal);
549
550protected:
555 UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category=Replication)
556 uint8 bReplicates:1;
557
559 void SetRemoteRoleForBackwardsCompat(const ENetRole InRemoteRole) { RemoteRole = InRemoteRole; }
560
562 UFUNCTION()
563 ENGINE_API virtual void OnRep_Owner();
564
566 UPROPERTY(Category=Actor, EditAnywhere, AdvancedDisplay)
567 uint8 bCanBeInCluster:1;
568
569#if WITH_EDITORONLY_DATA
571 UPROPERTY(Category = Actor, EditAnywhere, AdvancedDisplay)
573#endif
574
579 UPROPERTY()
580 uint8 bAllowReceiveTickEventOnDedicatedServer:1;
581
583 uint8 bNetCheckedInitialPhysicsState : 1;
584
589 UPROPERTY(Config, EditDefaultsOnly, BlueprintReadOnly, Category=Replication, AdvancedDisplay)
590 uint8 bReplicateUsingRegisteredSubObjectList : 1;
591
592private:
593 friend class FActorDeferredScriptManager;
594
596 uint8 bHasFinishedSpawning:1;
597
602 uint8 bActorInitialized:1;
603
605 uint8 bActorBeginningPlayFromLevelStreaming:1;
606
608 uint8 bTickFunctionsRegistered:1;
609
611 uint8 bHasDeferredComponentRegistration:1;
612
614 uint8 bRunningUserConstructionScript:1;
615
617 uint8 bHasPreRegisteredAllComponents : 1;
618
620 uint8 bHasRegisteredAllComponents:1;
621
626 UPROPERTY()
627 uint8 bActorEnableCollision:1;
628
630 UPROPERTY(Transient, DuplicateTransient)
631 uint8 bActorIsBeingDestroyed:1;
632
634 uint8 bActorWantsDestroyDuringBeginPlay : 1;
635
637 enum class EActorBeginPlayState : uint8
638 {
639 HasNotBegunPlay,
640 BeginningPlay,
641 HasBegunPlay,
642 };
643
648 EActorBeginPlayState ActorHasBegunPlay:2;
649
651 uint8 bActorIsBeingConstructed : 1;
652
654 uint8 bActorIsPendingPostNetInit : 1;
655
656 static ENGINE_API uint32 BeginPlayCallDepth;
657
658protected:
659
661 UPROPERTY(EditAnywhere, Category=Physics)
662 uint8 bAsyncPhysicsTickEnabled : 1;
663
678 UPROPERTY(Category=Collision, EditAnywhere)
679 EActorUpdateOverlapsMethod UpdateOverlapsMethodDuringLevelStreaming;
680
681public:
682
684 ENGINE_API EActorUpdateOverlapsMethod GetUpdateOverlapsMethodDuringLevelStreaming() const;
685
686private:
687
703 UPROPERTY(Config, Category = Collision, VisibleAnywhere)
704 EActorUpdateOverlapsMethod DefaultUpdateOverlapsMethodDuringLevelStreaming;
705
707 ENGINE_API void UpdateInitialOverlaps(bool bFromLevelStreaming);
708
710 UPROPERTY(Replicated, Transient, VisibleInstanceOnly, Category=Networking)
711 TEnumAsByte<enum ENetRole> RemoteRole;
712
713public:
721 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category=Networking)
722 ENGINE_API void SetReplicates(bool bInReplicates);
723
728 UFUNCTION(BlueprintCallable, Category=Networking)
729 ENGINE_API virtual void SetReplicateMovement(bool bInReplicateMovement);
730
732 ENGINE_API void SetAutonomousProxy(const bool bInAutonomousProxy, const bool bAllowForcePropertyCompare=true);
733
735 ENGINE_API void CopyRemoteRoleFrom(const AActor* CopyFromActor);
736
738 UFUNCTION(BlueprintCallable, Category=Networking)
739 ENetRole GetLocalRole() const { return Role; }
740
742 UFUNCTION(BlueprintCallable, Category=Networking)
743 ENetRole GetRemoteRole() const;
744
749 ENGINE_API void SetNetAddressable();
750
751public:
753 uint8 ActorCategory = 0;
754
756 UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Actor)
757 float InitialLifeSpan;
758
760 UPROPERTY(BlueprintReadWrite, AdvancedDisplay, Category=Actor)
761 float CustomTimeDilation;
762
763private:
765 UPROPERTY()
766 int32 RayTracingGroupId;
767
769#if WITH_EDITORONLY_DATA
772 UPROPERTY()
775
780 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category=WorldPartition)
781 FName RuntimeGrid;
782#endif
783
788 UPROPERTY(Transient, ReplicatedUsing=OnRep_AttachmentReplication)
789 struct FRepAttachment AttachmentReplication;
790
791private:
793 UPROPERTY(EditDefaultsOnly, ReplicatedUsing=OnRep_ReplicatedMovement, Category=Replication, AdvancedDisplay)
794 struct FRepMovement ReplicatedMovement;
795
796public:
801 UPROPERTY(ReplicatedUsing=OnRep_Owner)
803
804#if WITH_EDITOR
809#endif
810
811protected:
813 UPROPERTY()
814 FName NetDriverName;
815
816public:
818 const struct FRepAttachment& GetAttachmentReplication() const { return AttachmentReplication; }
819
821 UFUNCTION()
822 ENGINE_API virtual void OnRep_AttachmentReplication();
823
824private:
826 UPROPERTY(Replicated, VisibleInstanceOnly, Category=Networking)
828
829public:
831 UPROPERTY(BlueprintReadOnly, EditDefaultsOnly, Category=Replication)
833
835 UE_DEPRECATED(5.3, "Replication pausing is deprecated.")
836 ENGINE_API virtual bool IsReplicationPausedForConnection(const FNetViewer& ConnectionOwnerNetViewer);
837
839 UE_DEPRECATED(5.3, "Replication pausing is deprecated.")
840 ENGINE_API virtual void OnReplicationPausedChanged(bool bIsReplicationPaused);
841
843 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Actor)
844 ESpawnActorCollisionHandlingMethod SpawnCollisionHandlingMethod;
845
847 UPROPERTY(EditAnywhere, Category=Input)
848 TEnumAsByte<EAutoReceiveInput::Type> AutoReceiveInput;
849
851 UPROPERTY(EditAnywhere, Category=Input)
852 int32 InputPriority;
853
858 float CreationTime;
859
861 UPROPERTY(DuplicateTransient)
862 TObjectPtr<class UInputComponent> InputComponent;
863
866 int32 NetTag;
867
869 UE_DEPRECATED(5.5, "Public access to NetCullDistanceSquared has been deprecated. Use SetNetCullDistanceSquared() and GetNetCullDistanceSquared() instead.")
870 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite, meta=(AllowPrivateAccess=true), BlueprintGetter=GetNetCullDistanceSquared, BlueprintSetter=SetNetCullDistanceSquared)
872
874 UE_DEPRECATED(5.5, "Public access to NetUpdateFrequency has been deprecated. Use SetNetUpdateFrequency() and GetNetUpdateFrequency() instead.")
875 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite, meta=(AllowPrivateAccess=true), BlueprintGetter=GetNetUpdateFrequency, BlueprintSetter=SetNetUpdateFrequency)
876 float NetUpdateFrequency;
877
879 UE_DEPRECATED(5.5, "Public access MinNetUpdateFrequency has been deprecated. Use SetMinNetUpdateFrequency() and GetMinNetUpdateFrequency() instead.")
880 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite, meta=(AllowPrivateAccess=true), BlueprintGetter=GetMinNetUpdateFrequency, BlueprintSetter=SetMinNetUpdateFrequency)
882
884 UPROPERTY(Category=Replication, EditDefaultsOnly, BlueprintReadWrite)
885 float NetPriority;
886
887private:
889 UPROPERTY(EditDefaultsOnly, Category = Replication)
890 EPhysicsReplicationMode PhysicsReplicationMode;
891
892public:
894 UFUNCTION(BlueprintCallable, Category = Replication)
895 ENGINE_API void SetPhysicsReplicationMode(const EPhysicsReplicationMode ReplicationMode);
896
898 UFUNCTION(BlueprintCallable, Category = Replication)
899 ENGINE_API EPhysicsReplicationMode GetPhysicsReplicationMode();
900
902 UFUNCTION(BlueprintCallable, Category = Replication)
903 ENGINE_API void RegisterAsFocalPointInPhysicsReplicationLOD() const;
904
906 UFUNCTION(BlueprintCallable, Category = Replication)
907 ENGINE_API void UnregisterAsFocalPointInPhysicsReplicationLOD() const;
908
910 UFUNCTION(BlueprintCallable, Category = Physics)
911 ENGINE_API bool CanTriggerResimulation() const;
912
914 UFUNCTION(BlueprintCallable, Category = Physics)
915 ENGINE_API float GetResimulationThreshold() const;
916
917private:
923 FActorLastRenderTime LastRenderTime;
924
926
927public:
932 ENGINE_API void SetNetDriverName(FName NewNetDriverName);
933
935 FName GetNetDriverName() const { return NetDriverName; }
936
941 bool IsUsingRegisteredSubObjectList() const { return bReplicateUsingRegisteredSubObjectList; }
942
949 ENGINE_API virtual bool ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags);
950
952 ENGINE_API virtual void OnSubobjectCreatedFromReplication(UObject *NewSubobject);
953
955 ENGINE_API virtual void OnSubobjectDestroyFromReplication(UObject *Subobject);
956
961 ENGINE_API virtual void PreReplication(IRepChangedPropertyTracker & ChangedPropertyTracker);
962
967 ENGINE_API virtual void PreReplicationForReplay(IRepChangedPropertyTracker & ChangedPropertyTracker);
968
973 ENGINE_API virtual void RewindForReplay();
974
976 ENGINE_API void CallPreReplication(UNetDriver* NetDriver);
977
978private:
980 UPROPERTY(BlueprintReadWrite, ReplicatedUsing=OnRep_Instigator, meta=(ExposeOnSpawn=true, AllowPrivateAccess=true), Category=Actor)
981 TObjectPtr<class APawn> Instigator;
982
983public:
985 UFUNCTION()
986 ENGINE_API virtual void OnRep_Instigator();
987
991
994 UPROPERTY(BlueprintGetter=K2_GetRootComponent, Category="Transformation")
995 TObjectPtr<USceneComponent> RootComponent;
996
997#if WITH_EDITORONLY_DATA
999 UPROPERTY(EditAnywhere, BlueprintReadOnly, AdvancedDisplay, Category=Actor)
1000 FVector PivotOffset;
1001#endif
1002
1005
1006public:
1007#if WITH_EDITOR
1009 ENGINE_API class UHLODLayer* GetHLODLayer() const;
1010
1013
1015 static const FName GetHLODLayerPropertyName() { return GET_MEMBER_NAME_CHECKED(AActor, HLODLayer); }
1016#endif
1017
1019 UFUNCTION(BlueprintCallable, Category = RayTracing)
1020 ENGINE_API void SetRayTracingGroupId(int32 InRaytracingGroupId);
1021
1023 UFUNCTION(BlueprintCallable, Category = RayTracing)
1024 ENGINE_API int32 GetRayTracingGroupId() const;
1025
1026private:
1028 UPROPERTY(EditAnywhere, Category = HLOD, meta = (DisplayName = "HLOD Layer"))
1029 TObjectPtr<class UHLODLayer> HLODLayer;
1030
1031#if WITH_EDITORONLY_DATA
1035#endif
1036
1037public:
1039 inline bool AllowReceiveTickEventOnDedicatedServer() const { return bAllowReceiveTickEventOnDedicatedServer; }
1040
1042 inline bool IsRunningUserConstructionScript() const { return bRunningUserConstructionScript; }
1043
1045 UPROPERTY(EditAnywhere, AdvancedDisplay, Category = Actor)
1046 TArray< FName > Layers;
1047
1048private:
1049#if WITH_EDITORONLY_DATA
1051 UPROPERTY()
1053#endif
1054
1056 UPROPERTY()
1057 TWeakObjectPtr<UChildActorComponent> ParentComponent;
1058
1059#if WITH_EDITORONLY_DATA
1060protected:
1067 UPROPERTY(BluePrintReadOnly, AdvancedDisplay, Category=Actor, NonPIEDuplicateTransient, TextExportTransient, NonTransactional)
1068 FGuid ActorGuid;
1069
1075 UPROPERTY(BluePrintReadOnly, AdvancedDisplay, Category=Actor, Transient, NonPIEDuplicateTransient, TextExportTransient, NonTransactional)
1076 FGuid ActorInstanceGuid;
1077
1081 UPROPERTY(BluePrintReadOnly, AdvancedDisplay, Category=Actor, TextExportTransient, NonTransactional)
1082 FGuid ContentBundleGuid;
1083
1085 UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = DataLayers)
1086 TArray<FActorDataLayer> DataLayers;
1087
1089 UPROPERTY(EditAnywhere, AdvancedDisplay, Category = DataLayers, meta=(DisableLevelInstancePropertyOverride))
1091
1093
1094 UPROPERTY(VisibleAnywhere, AdvancedDisplay, Category = DataLayers, TextExportTransient)
1095 TObjectPtr<const UExternalDataLayerAsset> ExternalDataLayerAsset;
1096
1097public:
1100
1104
1106 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category=Rendering, meta=(DisplayName="Editor Billboard Scale"))
1108
1111 uint64 HiddenEditorViews;
1112#endif // WITH_EDITORONLY_DATA
1113
1114#if WITH_EDITOR
1121 ENGINE_API void SetPackageExternal(bool bExternal, bool bShouldDirty = true, UPackage* ActorExternalPackage = nullptr);
1122
1127 virtual bool ShouldLevelKeepRefIfExternal() const { return false; }
1128
1133 ENGINE_API bool IsMainWorldOnly() const;
1134
1136
1138 virtual FName GetRuntimeGrid() const { return RuntimeGrid; }
1139
1141 void SetRuntimeGrid(FName InRuntimeGrid) { RuntimeGrid = InRuntimeGrid; }
1142
1144 static const FName GetRuntimeGridPropertyName() { return GET_MEMBER_NAME_CHECKED(AActor, RuntimeGrid); }
1145
1147 inline const FGuid& GetActorGuid() const { return ActorGuid; }
1148
1150 inline const FGuid& GetActorInstanceGuid() const { return ActorInstanceGuid.IsValid() ? ActorInstanceGuid : ActorGuid; }
1151
1153 inline const FGuid& GetContentBundleGuid() const { return ContentBundleGuid; }
1154
1156 ENGINE_API virtual bool IsLockLocation() const;
1157
1160
1162 ENGINE_API virtual void OnPlayFromHere();
1163
1164 bool CanPlayFromHere() const { return bCanPlayFromHere; }
1165
1170
1171public:
1176
1181
1186
1188 virtual void OnLoadedActorAddedToLevel() {}
1189
1191 virtual void OnLoadedActorRemovedFromLevel() {}
1192#endif // WITH_EDITOR
1193
1194private:
1195#if WITH_EDITORONLY_DATA
1200 UPROPERTY()
1201 FString ActorLabel;
1202#endif
1203
1204#if !WITH_EDITORONLY_DATA && ACTOR_HAS_LABELS
1205 FString ActorLabel;
1206#endif
1207
1208public:
1209 FString GetActorNameOrLabel() const
1210 {
1211#if WITH_EDITORONLY_DATA || ACTOR_HAS_LABELS
1212 if (!ActorLabel.IsEmpty())
1213 {
1214 return ActorLabel;
1215 }
1216#endif
1217 return GetName();
1218 }
1219
1221 {
1222#if WITH_EDITORONLY_DATA || ACTOR_HAS_LABELS
1223 return ActorLabel;
1224#else
1225 return FStringView();
1226#endif
1227 }
1228
1229#if WITH_EDITORONLY_DATA
1230private:
1236 UPROPERTY()
1238
1240 UPROPERTY(TextExportTransient)
1242
1243public:
1245 UPROPERTY()
1246 uint8 bHiddenEd:1;
1247
1251
1254 uint8 bHiddenEdLayer:1;
1255
1258 uint8 bHiddenEdLevel:1;
1259
1262
1265
1266protected:
1268 UPROPERTY()
1270
1272 UPROPERTY()
1274
1276 UPROPERTY()
1277 uint8 bEditable:1;
1278
1280 UPROPERTY()
1282
1284 UPROPERTY(EditDefaultsOnly, AdvancedDisplay, Category=Cooking, meta=(DisplayName="Generate Optimized Blueprint Component Data"))
1286
1288 UPROPERTY()
1290
1296 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category=WorldPartition)
1297 uint8 bIsSpatiallyLoaded : 1;
1298
1299private:
1302 uint8 bHiddenEdTemporary:1;
1303
1306#endif // WITH_EDITORONLY_DATA
1307
1308public:
1310 UPROPERTY(EditAnywhere, BlueprintReadWrite, AdvancedDisplay, Category=Actor)
1312
1313
1314 //~==============================================================================================
1315 // Delegates
1316
1318 UPROPERTY(BlueprintAssignable, Category="Game|Damage")
1320
1322 UPROPERTY(BlueprintAssignable, Category="Game|Damage")
1323 FTakePointDamageSignature OnTakePointDamage;
1324
1326 UPROPERTY(BlueprintAssignable, Category="Game|Damage")
1327 FTakeRadialDamageSignature OnTakeRadialDamage;
1328
1334 UPROPERTY(BlueprintAssignable, Category="Collision")
1335 FActorBeginOverlapSignature OnActorBeginOverlap;
1336
1341 UPROPERTY(BlueprintAssignable, Category="Collision")
1342 FActorEndOverlapSignature OnActorEndOverlap;
1343
1345 UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
1347
1349 UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
1351
1353 UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
1355
1357 UPROPERTY(BlueprintAssignable, Category="Input|Mouse Input")
1359
1361 UPROPERTY(BlueprintAssignable, Category="Input|Touch Input")
1363
1365 UPROPERTY(BlueprintAssignable, Category="Input|Touch Input")
1367
1369 UPROPERTY(BlueprintAssignable, Category="Input|Touch Input")
1371
1373 UPROPERTY(BlueprintAssignable, Category="Input|Touch Input")
1375
1381 UPROPERTY(BlueprintAssignable, Category="Collision")
1383
1388 UFUNCTION(BlueprintCallable, Category="Input")
1389 ENGINE_API virtual void EnableInput(class APlayerController* PlayerController);
1390
1395 UFUNCTION(BlueprintCallable, Category="Input")
1397
1402 UFUNCTION(BlueprintCallable, Category="Input")
1403 ENGINE_API virtual void DisableInput(class APlayerController* PlayerController);
1404
1406 UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly="true", HideSelfPin="true", HidePin="InputAxisName"))
1407 ENGINE_API float GetInputAxisValue(const FName InputAxisName) const;
1408
1410 UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly="true", HideSelfPin="true", HidePin="InputAxisKey"))
1411 ENGINE_API float GetInputAxisKeyValue(const FKey InputAxisKey) const;
1412
1414 UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly="true", HideSelfPin="true", HidePin="InputAxisKey"))
1415 ENGINE_API FVector GetInputVectorAxisValue(const FKey InputAxisKey) const;
1416
1418 UFUNCTION(BlueprintCallable, meta=(BlueprintProtected = "true"), Category="Game")
1419 ENGINE_API APawn* GetInstigator() const;
1420
1425 template <class T>
1426 T* GetInstigator() const
1427 {
1428 return Cast<T>(GetInstigator());
1429 }
1430
1432 UFUNCTION(BlueprintCallable, meta=(BlueprintProtected = "true"), Category="Game")
1433 ENGINE_API AController* GetInstigatorController() const;
1434
1439 template<class T>
1440 T* GetInstigatorController() const
1441 {
1442 return Cast<T>(GetInstigatorController());
1443 }
1444
1445 //~=============================================================================
1446 // DataLayers functions.
1447#if WITH_EDITOR
1448protected:
1449 UE_DEPRECATED(5.4, "Use ActorTypeSupportsDataLayer instead.")
1450 virtual bool IsDataLayerTypeSupported(TSubclassOf<UDataLayerInstance> DataLayerType) const final { return false; }
1451private:
1452 virtual bool ActorTypeIsMainWorldOnly() const { return false; }
1454public:
1455 ENGINE_API bool AddDataLayer(const UDataLayerInstance* DataLayerInstance);
1456 ENGINE_API bool RemoveDataLayer(const UDataLayerInstance* DataLayerInstance);
1457 ENGINE_API bool CanAddDataLayer(const UDataLayerInstance* InDataLayerInstance, FText* OutReason = nullptr) const;
1458
1461
1463 ENGINE_API TArray<FName> GetDataLayerInstanceNames() const;
1466 static const FName GetDataLayerAssetsPropertyName() { return GET_MEMBER_NAME_CHECKED(AActor, DataLayerAssets); }
1467 static const FName GetDataLayerPropertyName() { return GET_MEMBER_NAME_CHECKED(AActor, DataLayers); }
1468
1469 ENGINE_API TArray<const UDataLayerAsset*> GetDataLayerAssets(bool bIncludeExternalDataLayerAsset = true) const;
1470 ENGINE_API bool HasExternalContent() const;
1471
1472 virtual bool ActorTypeSupportsDataLayer() const { return true; }
1473 virtual bool ActorTypeSupportsExternalDataLayer() const { return true; }
1474
1475 //~ Begin Deprecated
1476
1478
1479 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use AddDataLayer(UDataLayerInstance*)")
1480 ENGINE_API bool AddDataLayer(const UDEPRECATED_DataLayer* DataLayer);
1481
1482 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use RemoveDataLayer(UDataLayerInstance*)")
1483 ENGINE_API bool RemoveDataLayer(const UDEPRECATED_DataLayer* DataLayer);
1484
1486
1487 UE_DEPRECATED(5.3, "Use AActor::SupportsDataLayerType(TSubclassOf<UDataLayerInstance>) instead.")
1488 ENGINE_API bool SupportsDataLayer() const;
1489
1490 UE_DEPRECATED(5.3, "Use UDataLayerInstance::AddActor(AActor*) instead.")
1491 bool AddDataLayer(const UDataLayerAsset* DataLayerAsset) { return false; }
1492
1493 UE_DEPRECATED(5.3, "Use UDataLayerInstance::RemoveDataLayer(AActor*) instead.")
1494 bool RemoveDataLayer(const UDataLayerAsset* DataLayerAsset) { return false; }
1495
1496 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use AddDataLayer(UDataLayerAsset*)")
1498
1499 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use RemoveDataLayer(UDataLayerAsset*)")
1501
1502 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use ContainsDataLayer(const UDataLayerAsset*)")
1503 ENGINE_API bool ContainsDataLayer(const FActorDataLayer& ActorDataLayer) const;
1504
1505 UE_DEPRECATED(5.1, "Convert DataLayer using UDataLayerToAssetCommandlet and use GetDataLayerAssets() instead")
1506 TArray<FActorDataLayer> const& GetActorDataLayers() const { return DataLayers; }
1507
1508 UE_DEPRECATED(5.1, "Use GetDataLayerInstances() with no parameters instead")
1509 TArray<const UDataLayerInstance*> GetDataLayerInstances(const AWorldDataLayers* WorldDataLayers) const { return TArray<const UDataLayerInstance*>(); }
1510
1511 UE_DEPRECATED(5.1, "Use HasDataLayers() instead")
1512 bool HasValidDataLayers() const { return HasDataLayers(); }
1513
1514 //~ End Deprecated
1515#endif
1516
1517 ENGINE_API TArray<const UDataLayerInstance*> GetDataLayerInstances() const;
1518
1519 ENGINE_API bool ContainsDataLayer(const UDataLayerAsset* DataLayerAsset) const;
1520 ENGINE_API bool ContainsDataLayer(const UDataLayerInstance* DataLayerInstance) const;
1521 ENGINE_API bool HasDataLayers() const;
1522 ENGINE_API bool HasContentBundle() const;
1523 ENGINE_API const UExternalDataLayerAsset* GetExternalDataLayerAsset() const;
1524
1525private:
1526 ENGINE_API TArray<const UDataLayerInstance*> GetDataLayerInstancesInternal(bool bUseLevelContext, bool bIncludeParentDataLayers = true) const;
1527 ENGINE_API const IWorldPartitionCell* GetWorldPartitionRuntimeCell() const;
1528
1530 virtual bool SupportsIncrementalPreRegisterComponents() const
1531 {
1532 return true;
1533 }
1534
1536 virtual bool SupportsIncrementalPreUnregisterComponents() const
1537 {
1538 return true;
1539 }
1540
1542 ENGINE_API void IncrementalPreRegisterComponents();
1543
1545 bool HasPreRegisteredAllComponents() const { return bHasPreRegisteredAllComponents; }
1546
1548 ENGINE_API void IncrementalPreUnregisterComponents();
1549
1550 //~=============================================================================
1551 // General functions.
1552public:
1557 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Get Actor Transform", ScriptName = "GetActorTransform"), Category="Transformation")
1558 const FTransform& GetTransform() const
1559 {
1560 return ActorToWorld();
1561 }
1562
1564 inline const FTransform& ActorToWorld() const
1565 {
1566 return (RootComponent ? RootComponent->GetComponentTransform() : FTransform::Identity);
1567 }
1568
1570 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Get Actor Location", ScriptName = "GetActorLocation", Keywords="position"), Category="Transformation")
1571 FVector K2_GetActorLocation() const;
1572
1587 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Set Actor Location", ScriptName = "SetActorLocation", Keywords="position"), Category="Transformation")
1588 ENGINE_API bool K2_SetActorLocation(FVector NewLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1589
1591 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Get Actor Rotation", ScriptName = "GetActorRotation"), Category="Transformation")
1592 FRotator K2_GetActorRotation() const;
1593
1595 UFUNCTION(BlueprintCallable, Category = "Transformation")
1596 FVector GetActorForwardVector() const;
1597
1599 UFUNCTION(BlueprintCallable, Category = "Transformation")
1600 FVector GetActorUpVector() const;
1601
1603 UFUNCTION(BlueprintCallable, Category = "Transformation")
1604 FVector GetActorRightVector() const;
1605
1613 UFUNCTION(BlueprintCallable, Category="Collision", meta=(DisplayName = "Get Actor Bounds"))
1614 ENGINE_API virtual void GetActorBounds(bool bOnlyCollidingComponents, FVector& Origin, FVector& BoxExtent, bool bIncludeFromChildActors = false) const;
1615
1617 UFUNCTION(BlueprintGetter)
1618 USceneComponent* K2_GetRootComponent() const;
1619
1621 UFUNCTION(BlueprintCallable, Category="Transformation")
1622 ENGINE_API virtual FVector GetVelocity() const;
1623
1639 ENGINE_API bool SetActorLocation(const FVector& NewLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1640
1652 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Set Actor Rotation", ScriptName = "SetActorRotation"), Category="Transformation")
1653 ENGINE_API bool K2_SetActorRotation(FRotator NewRotation, bool bTeleportPhysics);
1654
1666 ENGINE_API bool SetActorRotation(FRotator NewRotation, ETeleportType Teleport = ETeleportType::None);
1667 ENGINE_API bool SetActorRotation(const FQuat& NewRotation, ETeleportType Teleport = ETeleportType::None);
1668
1685 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Set Actor Location And Rotation", ScriptName="SetActorLocationAndRotation"))
1686 ENGINE_API bool K2_SetActorLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1687
1704 ENGINE_API bool SetActorLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1705 ENGINE_API bool SetActorLocationAndRotation(FVector NewLocation, const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1706
1708 UFUNCTION(BlueprintCallable, Category="Transformation")
1709 ENGINE_API void SetActorScale3D(FVector NewScale3D);
1710
1712 UFUNCTION(BlueprintCallable, Category="Transformation")
1713 ENGINE_API FVector GetActorScale3D() const;
1714
1716 UFUNCTION(BlueprintCallable, Category = "Transformation")
1717 ENGINE_API float GetDistanceTo(const AActor* OtherActor) const;
1718
1720 UFUNCTION(BlueprintCallable, Category = "Transformation")
1721 ENGINE_API float GetSquaredDistanceTo(const AActor* OtherActor) const;
1722
1724 UFUNCTION(BlueprintCallable, Category = "Transformation")
1725 ENGINE_API float GetHorizontalDistanceTo(const AActor* OtherActor) const;
1726
1728 UFUNCTION(BlueprintCallable, Category = "Transformation")
1729 ENGINE_API float GetSquaredHorizontalDistanceTo(const AActor* OtherActor) const;
1730
1732 UFUNCTION(BlueprintCallable, Category = "Transformation")
1733 ENGINE_API float GetVerticalDistanceTo(const AActor* OtherActor) const;
1734
1736 UFUNCTION(BlueprintCallable, Category = "Transformation")
1737 ENGINE_API float GetDotProductTo(const AActor* OtherActor) const;
1738
1740 UFUNCTION(BlueprintCallable, Category = "Transformation")
1741 ENGINE_API float GetHorizontalDotProductTo(const AActor* OtherActor) const;
1742
1757 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor World Offset", ScriptName="AddActorWorldOffset", Keywords="location position"))
1758 ENGINE_API void K2_AddActorWorldOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1759 ENGINE_API void AddActorWorldOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1760
1774 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor World Rotation", ScriptName="AddActorWorldRotation", AdvancedDisplay="bSweep,SweepHitResult,bTeleport"))
1775 ENGINE_API void K2_AddActorWorldRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1776 ENGINE_API void AddActorWorldRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1777 ENGINE_API void AddActorWorldRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1778
1780 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor World Transform", ScriptName="AddActorWorldTransform"))
1781 ENGINE_API void K2_AddActorWorldTransform(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1782 ENGINE_API void AddActorWorldTransform(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1783
1785 UFUNCTION(BlueprintCallable, Category = "Transformation", meta = (DisplayName = "Add Actor World Transform Keep Scale", ScriptName = "AddActorWorldTransformKeepScale"))
1786 ENGINE_API void K2_AddActorWorldTransformKeepScale(const FTransform& DeltaTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1787 ENGINE_API void AddActorWorldTransformKeepScale(const FTransform& DeltaTransform, bool bSweep = false, FHitResult* OutSweepHitResult = nullptr, ETeleportType Teleport = ETeleportType::None);
1788
1801 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Set Actor Transform", ScriptName="SetActorTransform"))
1802 ENGINE_API bool K2_SetActorTransform(const FTransform& NewTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1803 ENGINE_API bool SetActorTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1804
1817 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor Local Offset", ScriptName="AddActorLocalOffset", Keywords="location position"))
1818 ENGINE_API void K2_AddActorLocalOffset(FVector DeltaLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1819 ENGINE_API void AddActorLocalOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1820
1833 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor Local Rotation", ScriptName="AddActorLocalRotation", AdvancedDisplay="bSweep,SweepHitResult,bTeleport"))
1834 ENGINE_API void K2_AddActorLocalRotation(FRotator DeltaRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1835 ENGINE_API void AddActorLocalRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1836 ENGINE_API void AddActorLocalRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1837
1850 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Add Actor Local Transform", ScriptName="AddActorLocalTransform"))
1851 ENGINE_API void K2_AddActorLocalTransform(const FTransform& NewTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1852 ENGINE_API void AddActorLocalTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1853
1866 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Set Actor Relative Location", ScriptName="SetActorRelativeLocation"))
1867 ENGINE_API void K2_SetActorRelativeLocation(FVector NewRelativeLocation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1868 ENGINE_API void SetActorRelativeLocation(FVector NewRelativeLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1869
1882 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Set Actor Relative Rotation", ScriptName="SetActorRelativeRotation", AdvancedDisplay="bSweep,SweepHitResult,bTeleport"))
1883 ENGINE_API void K2_SetActorRelativeRotation(FRotator NewRelativeRotation, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1884 ENGINE_API void SetActorRelativeRotation(FRotator NewRelativeRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1885 ENGINE_API void SetActorRelativeRotation(const FQuat& NewRelativeRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1886
1899 UFUNCTION(BlueprintCallable, Category="Transformation", meta=(DisplayName="Set Actor Relative Transform", ScriptName="SetActorRelativeTransform"))
1900 ENGINE_API void K2_SetActorRelativeTransform(const FTransform& NewRelativeTransform, bool bSweep, FHitResult& SweepHitResult, bool bTeleport);
1901 ENGINE_API void SetActorRelativeTransform(const FTransform& NewRelativeTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None);
1902
1907 UFUNCTION(BlueprintCallable, Category="Transformation")
1908 ENGINE_API void SetActorRelativeScale3D(FVector NewRelativeScale);
1909
1911 UFUNCTION(BlueprintCallable, Category="Transformation")
1912 ENGINE_API FVector GetActorRelativeScale3D() const;
1913
1918 ENGINE_API void MarkNeedsRecomputeBoundsOnceForGame();
1919
1924 UFUNCTION(BlueprintCallable, Category="Rendering", meta=( DisplayName = "Set Actor Hidden In Game", Keywords = "Visible Hidden Show Hide" ))
1925 ENGINE_API virtual void SetActorHiddenInGame(bool bNewHidden);
1926
1928 UFUNCTION(BlueprintCallable, Category="Collision")
1929 ENGINE_API void SetActorEnableCollision(bool bNewActorEnableCollision);
1930
1932 UFUNCTION(BlueprintPure, Category="Collision")
1933 bool GetActorEnableCollision() const;
1934
1936 UFUNCTION(BlueprintCallable, Category="Actor", meta=(Keywords = "Delete", DisplayName = "Destroy Actor", ScriptName = "DestroyActor"))
1937 ENGINE_API virtual void K2_DestroyActor();
1938
1940 UFUNCTION(BlueprintCallable, Category="Networking")
1941 bool HasAuthority() const;
1942
1959 UFUNCTION(BlueprintCallable, meta=(ScriptNoExport, BlueprintInternalUseOnly = "true", DefaultToSelf="ComponentTemplateContext", InternalUseParam="ComponentTemplateContext,bDeferredFinish"))
1961
1977 UFUNCTION(BlueprintCallable, meta=(ScriptNoExport, BlueprintInternalUseOnly = "true", InternalUseParam="bDeferredFinish"))
1978 ENGINE_API UActorComponent* AddComponentByClass(UPARAM(meta = (AllowAbstract = "false")) TSubclassOf<UActorComponent> Class, bool bManualAttachment, const FTransform& RelativeTransform, bool bDeferredFinish);
1979
1990 UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly="true"))
1991 ENGINE_API void FinishAddComponent(UActorComponent* Component, bool bManualAttachment, const FTransform& RelativeTransform);
1992
1994 UE_DEPRECATED(4.17, "Use AttachToComponent() instead.")
1995 UFUNCTION(BlueprintCallable, meta = (DisplayName = "AttachRootComponentTo (Deprecated)", ScriptNoExport, AttachLocationType = "KeepRelativeOffset"), Category = "Transformation")
1996 ENGINE_API void K2_AttachRootComponentTo(USceneComponent* InParent, FName InSocketName = NAME_None, EAttachLocation::Type AttachLocationType = EAttachLocation::KeepRelativeOffset, bool bWeldSimulatedBodies = true);
1997
2008 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Attach Actor To Component", ScriptName = "AttachToComponent", bWeldSimulatedBodies = true), Category = "Transformation")
2009 ENGINE_API bool K2_AttachToComponent(USceneComponent* Parent, FName SocketName, EAttachmentRule LocationRule, EAttachmentRule RotationRule, EAttachmentRule ScaleRule, bool bWeldSimulatedBodies);
2010
2018 ENGINE_API bool AttachToComponent(USceneComponent* Parent, const FAttachmentTransformRules& AttachmentRules, FName SocketName = NAME_None);
2019
2021 UE_DEPRECATED(4.17, "Use AttachToActor() instead.")
2022 UFUNCTION(BlueprintCallable, meta = (DisplayName = "AttachRootComponentToActor (Deprecated)", ScriptNoExport, AttachLocationType = "KeepRelativeOffset"), Category = "Transformation")
2023 ENGINE_API void K2_AttachRootComponentToActor(AActor* InParentActor, FName InSocketName = NAME_None, EAttachLocation::Type AttachLocationType = EAttachLocation::KeepRelativeOffset, bool bWeldSimulatedBodies = true);
2024
2032 ENGINE_API bool AttachToActor(AActor* ParentActor, const FAttachmentTransformRules& AttachmentRules, FName SocketName = NAME_None);
2033
2044 UFUNCTION(BlueprintCallable, meta = (DisplayName = "Attach Actor To Actor", ScriptName = "AttachToActor", bWeldSimulatedBodies=true), Category = "Transformation")
2045 ENGINE_API bool K2_AttachToActor(AActor* ParentActor, FName SocketName, EAttachmentRule LocationRule, EAttachmentRule RotationRule, EAttachmentRule ScaleRule, bool bWeldSimulatedBodies);
2046
2048 UE_DEPRECATED(4.17, "Use DetachFromActor() instead")
2049 UFUNCTION(BlueprintCallable, meta=(DisplayName = "DetachActorFromActor (Deprecated)", ScriptNoExport), Category="Transformation")
2051
2058 UFUNCTION(BlueprintCallable, meta=(DisplayName = "Detach From Actor", ScriptName = "DetachFromActor"), Category="Transformation")
2060
2065 ENGINE_API void DetachFromActor(const FDetachmentTransformRules& DetachmentRules);
2066
2072 ENGINE_API void DetachAllSceneComponents(class USceneComponent* InParentComponent, const FDetachmentTransformRules& DetachmentRules);
2073
2075 UFUNCTION(BlueprintCallable, Category="Actor")
2076 ENGINE_API bool ActorHasTag(FName Tag) const;
2077
2078
2079 //~==============================================================================
2080 // Misc Blueprint support
2081
2086 UFUNCTION(BlueprintCallable, Category="Actor")
2087 ENGINE_API float GetActorTimeDilation() const;
2088
2092 ENGINE_API float GetActorTimeDilation(const UWorld& ActorWorld) const;
2093
2095 UFUNCTION(BlueprintCallable, Category="Actor|Tick", meta=(Keywords = "dependency"))
2096 ENGINE_API virtual void AddTickPrerequisiteActor(AActor* PrerequisiteActor);
2097
2099 UFUNCTION(BlueprintCallable, Category="Actor|Tick", meta=(Keywords = "dependency"))
2100 ENGINE_API virtual void AddTickPrerequisiteComponent(UActorComponent* PrerequisiteComponent);
2101
2103 UFUNCTION(BlueprintCallable, Category="Actor|Tick", meta=(Keywords = "dependency"))
2104 ENGINE_API virtual void RemoveTickPrerequisiteActor(AActor* PrerequisiteActor);
2105
2107 UFUNCTION(BlueprintCallable, Category="Actor|Tick", meta=(Keywords = "dependency"))
2108 ENGINE_API virtual void RemoveTickPrerequisiteComponent(UActorComponent* PrerequisiteComponent);
2109
2111 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2112 ENGINE_API bool GetTickableWhenPaused();
2113
2115 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2116 ENGINE_API void SetTickableWhenPaused(bool bTickableWhenPaused);
2117
2119 UFUNCTION(BlueprintPure, Category=Actor)
2120 ENGINE_API float GetGameTimeSinceCreation() const;
2121
2122protected:
2124 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "BeginPlay"))
2125 ENGINE_API void ReceiveBeginPlay();
2126
2128 ENGINE_API virtual void BeginPlay();
2129
2131 UFUNCTION(BlueprintImplementableEvent, meta=(Keywords = "delete", DisplayName = "End Play"))
2132 ENGINE_API void ReceiveEndPlay(EEndPlayReason::Type EndPlayReason);
2133
2135 ENGINE_API virtual void EndPlay(const EEndPlayReason::Type EndPlayReason);
2136
2137public:
2139 ENGINE_API void DispatchBeginPlay(bool bFromLevelStreaming = false);
2140
2142 bool IsActorInitialized() const { return bActorInitialized; }
2143
2145 bool IsActorBeginningPlay() const { return ActorHasBegunPlay == EActorBeginPlayState::BeginningPlay; }
2146
2148 bool HasActorBegunPlay() const { return ActorHasBegunPlay == EActorBeginPlayState::HasBegunPlay; }
2149
2151 bool IsActorBeginningPlayFromLevelStreaming() const { return bActorBeginningPlayFromLevelStreaming; }
2152
2154 UFUNCTION(BlueprintCallable, Category="Game")
2155 bool IsActorBeingDestroyed() const
2156 {
2157 return bActorIsBeingDestroyed;
2158 }
2159
2164 bool HasActorRegisteredAllComponents() const { return bHasRegisteredAllComponents; }
2165
2167 void SetHasActorRegisteredAllComponents() { bHasRegisteredAllComponents = true; }
2168
2170 UFUNCTION(BlueprintImplementableEvent, BlueprintAuthorityOnly, meta=(DisplayName = "AnyDamage"), Category="Game|Damage")
2171 ENGINE_API void ReceiveAnyDamage(float Damage, const class UDamageType* DamageType, class AController* InstigatedBy, AActor* DamageCauser);
2172
2174 UFUNCTION(BlueprintImplementableEvent, BlueprintAuthorityOnly, meta=(DisplayName = "RadialDamage"), Category="Game|Damage")
2175 ENGINE_API void ReceiveRadialDamage(float DamageReceived, const class UDamageType* DamageType, FVector Origin, const struct FHitResult& HitInfo, class AController* InstigatedBy, AActor* DamageCauser);
2176
2178 UFUNCTION(BlueprintImplementableEvent, BlueprintAuthorityOnly, meta=(DisplayName = "PointDamage"), Category="Game|Damage")
2179 ENGINE_API void ReceivePointDamage(float Damage, const class UDamageType* DamageType, FVector HitLocation, FVector HitNormal, class UPrimitiveComponent* HitComponent, FName BoneName, FVector ShotFromDirection, class AController* InstigatedBy, AActor* DamageCauser, const FHitResult& HitInfo);
2180
2182 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "Tick"))
2183 ENGINE_API void ReceiveTick(float DeltaSeconds);
2184
2186 UFUNCTION(BlueprintImplementableEvent, meta = (DisplayName = "Async Physics Tick"))
2187 ENGINE_API void ReceiveAsyncPhysicsTick(float DeltaSeconds, float SimSeconds);
2188
2194 ENGINE_API virtual void NotifyActorBeginOverlap(AActor* OtherActor);
2200 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorBeginOverlap"), Category="Collision")
2201 ENGINE_API void ReceiveActorBeginOverlap(AActor* OtherActor);
2202
2207 ENGINE_API virtual void NotifyActorEndOverlap(AActor* OtherActor);
2212 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorEndOverlap"), Category="Collision")
2213 ENGINE_API void ReceiveActorEndOverlap(AActor* OtherActor);
2214
2216 ENGINE_API virtual void NotifyActorBeginCursorOver();
2218 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorBeginCursorOver"), Category="Mouse Input")
2219 ENGINE_API void ReceiveActorBeginCursorOver();
2220
2222 ENGINE_API virtual void NotifyActorEndCursorOver();
2224 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorEndCursorOver"), Category="Mouse Input")
2225 ENGINE_API void ReceiveActorEndCursorOver();
2226
2228 ENGINE_API virtual void NotifyActorOnClicked(FKey ButtonPressed = EKeys::LeftMouseButton);
2230 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorOnClicked"), Category="Mouse Input")
2231 ENGINE_API void ReceiveActorOnClicked(FKey ButtonPressed = EKeys::LeftMouseButton);
2232
2234 ENGINE_API virtual void NotifyActorOnReleased(FKey ButtonReleased = EKeys::LeftMouseButton);
2236 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "ActorOnReleased"), Category="Mouse Input")
2237 ENGINE_API void ReceiveActorOnReleased(FKey ButtonReleased = EKeys::LeftMouseButton);
2238
2240 ENGINE_API virtual void NotifyActorOnInputTouchBegin(const ETouchIndex::Type FingerIndex);
2242 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "BeginInputTouch"), Category="Touch Input")
2243 ENGINE_API void ReceiveActorOnInputTouchBegin(const ETouchIndex::Type FingerIndex);
2244
2246 ENGINE_API virtual void NotifyActorOnInputTouchEnd(const ETouchIndex::Type FingerIndex);
2248 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "EndInputTouch"), Category="Touch Input")
2249 ENGINE_API void ReceiveActorOnInputTouchEnd(const ETouchIndex::Type FingerIndex);
2250
2252 ENGINE_API virtual void NotifyActorOnInputTouchEnter(const ETouchIndex::Type FingerIndex);
2254 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "TouchEnter"), Category="Touch Input")
2255 ENGINE_API void ReceiveActorOnInputTouchEnter(const ETouchIndex::Type FingerIndex);
2256
2258 ENGINE_API virtual void NotifyActorOnInputTouchLeave(const ETouchIndex::Type FingerIndex);
2260 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "TouchLeave"), Category="Touch Input")
2261 ENGINE_API void ReceiveActorOnInputTouchLeave(const ETouchIndex::Type FingerIndex);
2262
2268 UFUNCTION(BlueprintCallable, Category="Collision", meta=(UnsafeDuringActorConstruction="true", DeterminesOutputType="ClassFilter", DynamicOutputParam="OverlappingActors"))
2269 ENGINE_API void GetOverlappingActors(TArray<AActor*>& OverlappingActors, TSubclassOf<AActor> ClassFilter=nullptr) const;
2270
2276 ENGINE_API void GetOverlappingActors(TSet<AActor*>& OverlappingActors, TSubclassOf<AActor> ClassFilter=nullptr) const;
2277
2279 UFUNCTION(BlueprintCallable, Category="Collision", meta=(UnsafeDuringActorConstruction="true"))
2280 ENGINE_API void GetOverlappingComponents(TArray<UPrimitiveComponent*>& OverlappingComponents) const;
2281
2283 ENGINE_API void GetOverlappingComponents(TSet<UPrimitiveComponent*>& OverlappingComponents) const;
2284
2294 ENGINE_API virtual void NotifyHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit);
2305 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName = "Hit"), Category="Collision")
2306 ENGINE_API void ReceiveHit(class UPrimitiveComponent* MyComp, AActor* Other, class UPrimitiveComponent* OtherComp, bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult& Hit);
2307
2309 UFUNCTION(BlueprintCallable, Category="Actor", meta=(Keywords = "delete destroy"))
2310 ENGINE_API virtual void SetLifeSpan( float InLifespan );
2311
2313 UFUNCTION(BlueprintCallable, Category="Actor", meta=(Keywords = "delete destroy"))
2314 ENGINE_API virtual float GetLifeSpan() const;
2315
2320 UFUNCTION(BlueprintImplementableEvent, meta=(BlueprintInternalUseOnly = "true", DisplayName = "Construction Script"))
2322
2331
2333 UFUNCTION(BlueprintImplementableEvent, meta = (Keywords = "delete", DisplayName = "Destroyed"))
2334 ENGINE_API void ReceiveDestroyed();
2335
2337 UPROPERTY(BlueprintAssignable, Category="Game")
2339
2341 UPROPERTY(BlueprintAssignable, Category="Game")
2343
2344 //~ Begin UObject Interface
2347 ENGINE_API virtual void ProcessEvent( UFunction* Function, void* Parameters ) override;
2349 ENGINE_API virtual bool CallRemoteFunction( UFunction* Function, void* Parameters, FOutParmRec* OutParms, FFrame* Stack ) override;
2353#if UE_WITH_REMOTE_OBJECT_HANDLE
2354 ENGINE_API virtual void PostMigrate(const struct FUObjectMigrationContext& MigrationContext) override;
2355 ENGINE_API virtual bool IsMigrationRoot() const override;
2356#endif
2357 ENGINE_API virtual void BeginDestroy() override;
2358#if !UE_STRIP_DEPRECATED_PROPERTIES
2359 ENGINE_API virtual bool IsReadyForFinishDestroy() override;
2360#endif
2361 ENGINE_API virtual bool Rename( const TCHAR* NewName=nullptr, UObject* NewOuter=nullptr, ERenameFlags Flags=REN_None ) override;
2362 ENGINE_API virtual void PostRename( UObject* OldOuter, const FName OldName ) override;
2363 ENGINE_API virtual bool CanBeInCluster() const override;
2365 ENGINE_API virtual bool IsEditorOnly() const override;
2366 virtual bool IsEditorOnlyLoadedInPIE() const { return false; }
2367 virtual bool IsRuntimeOnly() const { return false; }
2368 ENGINE_API virtual bool IsAsset() const override;
2369
2370 ENGINE_API virtual void PreSaveRoot(FObjectPreSaveRootContext ObjectSaveContext) override;
2371 ENGINE_API virtual void PostSaveRoot(FObjectPostSaveRootContext ObjectSaveContext) override;
2372 ENGINE_API virtual void PreSave(FObjectPreSaveContext ObjectSaveContext) override;
2373
2375 ENGINE_API bool IsMainPackageActor() const;
2376
2377 static ENGINE_API AActor* FindActorInPackage(UPackage* InPackage, bool bEvenIfPendingKill = true);
2378
2379#if WITH_EDITOR
2380 ENGINE_API virtual bool Modify(bool bAlwaysMarkDirty = true) override;
2382 UE_DEPRECATED(5.4, "Implement the version that takes FAssetRegistryTagsContext instead.")
2383 ENGINE_API virtual void GetAssetRegistryTags(TArray<FAssetRegistryTag>& OutTags) const override;
2384 ENGINE_API virtual bool NeedsLoadForTargetPlatform(const ITargetPlatform* TargetPlatform) const;
2387 ENGINE_API virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override;
2393
2395 struct UE_DEPRECATED(5.6, "Use PreDuplicateFromRoot instead.") FDuplicationSeedInterface
2396 {
2397 public:
2399
2401 ENGINE_API void AddEntry(UObject* Source, UObject* Dest) {}
2402 };
2403
2406 UE_DEPRECATED(5.6, "Use PreDuplicateFromRoot instead.")
2409
2411 virtual bool IsDefaultPreviewEnabled() const
2412 {
2413 return true;
2414 }
2415
2417 virtual bool IsUserManaged() const { return true; }
2418
2420 ENGINE_API virtual bool CanDeleteSelectedActor(FText& OutReason) const;
2421
2424
2426 ENGINE_API virtual bool SupportsExternalPackaging() const;
2427#endif
2428
2429#if WITH_EDITOR
2432
2435
2438
2440 ENGINE_API virtual void PostEditMove(bool bFinished);
2441#endif // WITH_EDITOR
2442 //~ End UObject Interface
2443
2444#if WITH_EDITOR
2447#endif
2449 ENGINE_API virtual void PreSaveFromRoot(FObjectPreSaveRootContext ObjectSaveContext);
2450 ENGINE_API virtual void PostSaveFromRoot(FObjectPostSaveRootContext ObjectSaveContext);
2451
2452#if WITH_EDITOR
2454#endif
2455
2456 //~=============================================================================
2457 // Property Replication
2458
2460 ENGINE_API virtual void GatherCurrentMovement();
2461
2463 inline bool IsOwnedBy( const AActor* TestOwner ) const
2464 {
2465 for( const AActor* Arg=this; Arg; Arg=Arg->Owner )
2466 {
2467 if( Arg == TestOwner )
2468 return true;
2469 }
2470 return false;
2471 }
2472
2474 inline USceneComponent* GetRootComponent() const { return RootComponent; }
2475
2480 virtual USceneComponent* GetDefaultAttachComponent() const { return GetRootComponent(); }
2481
2486 ENGINE_API bool SetRootComponent(USceneComponent* NewRootComponent);
2487
2489 inline const FTransform& GetActorTransform() const
2490 {
2491 return TemplateGetActorTransform(ToRawPtr(RootComponent));
2492 }
2493
2496 {
2497 return TemplateGetActorLocation(ToRawPtr(RootComponent));
2498 }
2499
2502 {
2503 return TemplateGetActorRotation(ToRawPtr(RootComponent));
2504 }
2505
2507 inline FVector GetActorScale() const
2508 {
2509 return TemplateGetActorScale(ToRawPtr(RootComponent));
2510 }
2511
2513 inline FQuat GetActorQuat() const
2514 {
2515 return TemplateGetActorQuat(ToRawPtr(RootComponent));
2516 }
2517
2518#if WITH_EDITOR
2520 inline void SetPivotOffset(const FVector& InPivotOffset)
2521 {
2522 PivotOffset = InPivotOffset;
2523 }
2524
2526 inline FVector GetPivotOffset() const
2527 {
2528 return PivotOffset;
2529 }
2530
2539 ENGINE_API virtual void GetStreamingBounds(FBox& OutRuntimeBounds, FBox& OutEditorBounds) const;
2540
2541 UE_DEPRECATED(5.5, "Use the override that takes both Runtime and Editor boxes")
2542 ENGINE_API FBox GetStreamingBounds() const;
2543#endif
2544
2545
2546 //~=============================================================================
2547 // Relations
2548
2555 ENGINE_API virtual void ApplyWorldOffset(const FVector& InOffset, bool bWorldShift);
2556
2558 virtual bool IsLevelBoundsRelevant() const { return bRelevantForLevelBounds; }
2559
2561 ENGINE_API virtual bool IsHLODRelevant() const;
2562
2564 ENGINE_API virtual bool HasHLODRelevantComponents() const;
2565
2567 ENGINE_API virtual TArray<UActorComponent*> GetHLODRelevantComponents() const;
2568
2574 ENGINE_API void SetLODParent(class UPrimitiveComponent* InLODParent, float InParentDrawDistance);
2575
2576#if WITH_EDITOR
2579
2585
2590 ENGINE_API virtual void EditorApplyRotation(const FRotator& DeltaRotation, bool bAltDown, bool bShiftDown, bool bCtrlDown);
2591
2596 ENGINE_API virtual void EditorApplyScale(const FVector& DeltaScale, const FVector* PivotLocation, bool bAltDown, bool bShiftDown, bool bCtrlDown);
2597
2600
2603
2605 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2607 {
2608 return bHiddenEd;
2609 }
2610
2612 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2613 ENGINE_API virtual bool IsHiddenEd() const;
2614
2619 UFUNCTION(BlueprintCallable, Category="Editor Scripting | Actor Editing")
2620 ENGINE_API virtual void SetIsTemporarilyHiddenInEditor( bool bIsHidden );
2621
2624
2626 ENGINE_API virtual bool SupportsLayers() const;
2627
2630
2632 {
2633 if (IsPackageExternal())
2634 {
2636 }
2637 }
2638
2640 ENGINE_API bool GetIsSpatiallyLoaded() const;
2641
2643 void SetIsSpatiallyLoaded(bool bInIsSpatiallyLoaded)
2644 {
2645 if (bIsSpatiallyLoaded != bInIsSpatiallyLoaded)
2646 {
2648 bIsSpatiallyLoaded = bInIsSpatiallyLoaded;
2649 }
2650 }
2651
2653 ENGINE_API virtual bool CanChangeIsSpatiallyLoadedFlag() const;
2654
2656 static const FName GetIsSpatiallyLoadedPropertyName() { return GET_MEMBER_NAME_CHECKED(AActor, bIsSpatiallyLoaded); }
2657
2662 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2664
2666 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2667 ENGINE_API bool IsEditable() const;
2668
2670 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2671 ENGINE_API virtual bool IsSelectable() const;
2672
2675
2678
2681
2683 virtual bool EditorCanDetachFrom(const AActor* InParent, FText& OutReason) const { return true; }
2684
2686 ENGINE_API virtual AActor* GetSceneOutlinerParent() const;
2687
2689 UE_DEPRECATED(5.6, "Please use GetSceneOutlinerItemPackage or GetSceneOutlinerTopParentPackage instead.")
2691
2694
2697
2699 virtual bool ShouldExport() { return true; }
2700
2702 UE_DEPRECATED(5.2, "Use the override that takes a StringView instead")
2704
2706 virtual bool ShouldImport(FStringView ActorPropString, bool IsMovingLevel) { return true; }
2707
2709 UE_DEPRECATED(5.4, "Please use UI Commands and process your custom actors as necessary by extending the level editor modules' global command list.")
2711
2714
2719 ENGINE_API virtual void CheckForErrors();
2720
2725 ENGINE_API virtual void CheckForDeprecated();
2726
2728 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing", meta = (KeyWords = "Display Name"))
2729 ENGINE_API virtual FString GetDefaultActorLabel() const;
2730
2732 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing", meta = (KeyWords = "Display Name"))
2733 ENGINE_API const FString& GetActorLabel(bool bCreateIfNone = true) const;
2734
2740 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing", meta = (KeyWords = "Display Name"))
2741 ENGINE_API void SetActorLabel( const FString& NewActorLabel, bool bMarkDirty = true );
2742
2745
2748
2754
2756 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2758
2759 /*
2760 * Returns actor folder guid. If level is not using actor folder objects, returns an invalid guid.
2761 * @param bDirectAccess If true, returns the raw value without testing if level uses Actor Folders.
2762 */
2764
2767
2770
2773
2776
2781 UFUNCTION(BlueprintCallable, Category = "Editor Scripting | Actor Editing")
2783
2789
2796
2799
2801 virtual bool OpenAssetEditor() { return false; }
2802
2805
2807 virtual FName GetCustomIconName() const { return NAME_None; }
2808
2810 inline bool ShouldCookOptimizedBPComponentData() const
2811 {
2813 }
2814
2816 UE_DEPRECATED(5.7, "SetBrowseToAssetOverride is deprecated as it was unreliable. Register a callback with UBrowseToAssetOverrideSubsystem instead, and store the override as a property on your actor.")
2817 ENGINE_API void SetBrowseToAssetOverride(const FString& PackageName);
2820 ENGINE_API const FString& GetBrowseToAssetOverride() const;
2821#endif // WITH_EDITOR
2822
2834 ENGINE_API virtual float GetNetPriority(const FVector& ViewPos, const FVector& ViewDir, class AActor* Viewer, AActor* ViewTarget, UActorChannel* InChannel, float Time, bool bLowBandwidth);
2835
2846 ENGINE_API virtual float GetReplayPriority(const FVector& ViewPos, const FVector& ViewDir, class AActor* Viewer, AActor* ViewTarget, UActorChannel* const InChannel, float Time);
2847
2849 ENGINE_API virtual bool GetNetDormancy(const FVector& ViewPos, const FVector& ViewDir, class AActor* Viewer, AActor* ViewTarget, UActorChannel* InChannel, float Time, bool bLowBandwidth);
2850
2856 virtual void OnActorChannelOpen(class FInBunch& InBunch, class UNetConnection* Connection) {};
2857
2863 virtual bool UseShortConnectTimeout() const { return false; }
2864
2869 virtual void OnSerializeNewActor(class FOutBunch& OutBunch) {};
2870
2875 virtual void OnNetCleanup(class UNetConnection* Connection) {};
2876
2878 ENGINE_API void ExchangeNetRoles(bool bRemoteOwner);
2879
2881 ENGINE_API void SwapRoles();
2882
2889 ENGINE_API void RegisterAllActorTickFunctions(bool bRegister, bool bDoComponents);
2890
2896 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2897 ENGINE_API virtual void SetActorTickEnabled(bool bEnabled);
2898
2900 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2901 ENGINE_API bool IsActorTickEnabled() const;
2902
2907 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2908 ENGINE_API void SetActorTickInterval(float TickInterval);
2909
2911 UFUNCTION(BlueprintCallable, Category="Actor|Tick")
2912 ENGINE_API float GetActorTickInterval() const;
2913
2920 ENGINE_API virtual void TickActor( float DeltaTime, enum ELevelTick TickType, FActorTickFunction& ThisTickFunction );
2921
2929 virtual void AsyncPhysicsTickActor(float DeltaTime, float SimTime) { ReceiveAsyncPhysicsTick(DeltaTime, SimTime); }
2930
2936 ENGINE_API virtual void PostActorCreated();
2937
2939 ENGINE_API virtual void LifeSpanExpired();
2940
2942 ENGINE_API virtual void PreNetReceive() override;
2943
2945 ENGINE_API virtual void PostNetReceive() override;
2946
2948 ENGINE_API virtual void PostNetReceiveRole();
2949
2951 ENGINE_API virtual bool IsNameStableForNetworking() const override;
2952
2954 ENGINE_API virtual bool IsSupportedForNetworking() const override;
2955
2957 ENGINE_API virtual void PostNetInit();
2958
2960 UFUNCTION()
2961 ENGINE_API virtual void OnRep_ReplicatedMovement();
2962
2964 ENGINE_API virtual void PostNetReceiveLocationAndRotation();
2965
2967 ENGINE_API virtual void PostNetReceiveVelocity(const FVector& NewVelocity);
2968
2970 ENGINE_API virtual void PostNetReceivePhysicState();
2971
2975 void SetFakeNetPhysicsState(bool bShouldSleep);
2976
2977protected:
2979 ENGINE_API void SyncReplicatedPhysicsSimulation();
2980
2981public:
2986 UFUNCTION(BlueprintCallable, Category=Actor)
2987 ENGINE_API virtual void SetOwner( AActor* NewOwner );
2988
2990 UFUNCTION(BlueprintCallable, Category=Actor)
2991 AActor* GetOwner() const;
2992
2994 template< class T >
2995 T* GetOwner() const
2996 {
2997 return Cast<T>(GetOwner());
2998 }
2999
3004 ENGINE_API virtual bool CheckStillInWorld();
3005
3006#if WITH_EDITOR
3008 ENGINE_API virtual EDataValidationResult IsDataValid(class FDataValidationContext& Context) const override;
3009#endif // WITH_EDITOR
3010
3011
3012 //~=============================================================================
3013 // Actor overlap tracking
3014
3019 ENGINE_API void ClearComponentOverlaps();
3020
3025 ENGINE_API void UpdateOverlaps(bool bDoNotifies=true);
3026
3032 UFUNCTION(BlueprintCallable, Category="Collision", meta=(UnsafeDuringActorConstruction="true"))
3033 ENGINE_API bool IsOverlappingActor(const AActor* Other) const;
3034
3036 ENGINE_API bool IsRootComponentStatic() const;
3037
3039 ENGINE_API bool IsRootComponentStationary() const;
3040
3042 ENGINE_API bool IsRootComponentMovable() const;
3043
3045 ENGINE_API virtual APhysicsVolume* GetPhysicsVolume() const;
3046
3047 //~=============================================================================
3048 // Actor ticking
3049
3051 inline bool CanEverTick() const { return PrimaryActorTick.bCanEverTick; }
3052
3059 ENGINE_API virtual void Tick( float DeltaSeconds );
3060
3062 ENGINE_API virtual bool ShouldTickIfViewportsOnly() const;
3063
3064
3065 //~=============================================================================
3066 // Actor relevancy determination
3067
3068protected:
3076 ENGINE_API bool IsWithinNetRelevancyDistance(const FVector& SrcLocation) const;
3077
3078public:
3088 ENGINE_API virtual bool IsNetRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation) const;
3089
3099 ENGINE_API virtual bool IsReplayRelevantFor(const AActor* RealViewer, const AActor* ViewTarget, const FVector& SrcLocation, const float CullDistanceSquared) const;
3100
3110 ENGINE_API virtual bool IsRelevancyOwnerFor(const AActor* ReplicatedActor, const AActor* ActorOwner, const AActor* ConnectionActor) const;
3111
3113 ENGINE_API void PostSpawnInitialize(FTransform const& SpawnTransform, AActor* InOwner, APawn* InInstigator, bool bRemoteOwned, bool bNoFail, bool bDeferConstruction, ESpawnActorScaleMethod TransformScaleMethod = ESpawnActorScaleMethod::MultiplyWithRoot);
3114
3116 ENGINE_API void FinishSpawning(const FTransform& Transform, bool bIsDefaultTransform = false, const FComponentInstanceDataCache* InstanceDataCache = nullptr, ESpawnActorScaleMethod TransformScaleMethod = ESpawnActorScaleMethod::OverrideRootScale);
3117
3119 ENGINE_API void PostActorConstruction();
3120
3121public:
3123 ENGINE_API virtual void PreInitializeComponents();
3124
3126 ENGINE_API virtual void PostInitializeComponents();
3127
3128
3130 ENGINE_API virtual void DispatchPhysicsCollisionHit(const struct FRigidBodyCollisionInfo& MyInfo, const struct FRigidBodyCollisionInfo& OtherInfo, const FCollisionImpactData& RigidCollisionData);
3131
3133 virtual const AActor* GetNetOwner() const;
3134
3136 ENGINE_API virtual class UPlayer* GetNetOwningPlayer();
3137
3139 ENGINE_API virtual class UPlayer* GetNetOwningPlayerAnyRole();
3140
3145 ENGINE_API virtual class UNetConnection* GetNetConnection() const;
3146
3153 ENGINE_API virtual bool DestroyNetworkActorHandled();
3154
3159 ENetMode GetNetMode() const;
3160
3166 bool IsNetMode(ENetMode Mode) const;
3167
3169 ENGINE_API class UNetDriver* GetNetDriver() const;
3170
3172 UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Networking")
3173 ENGINE_API void SetNetDormancy(ENetDormancy NewDormancy);
3174
3176 UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category="Networking")
3177 ENGINE_API void FlushNetDormancy();
3178
3181
3183 UFUNCTION(BlueprintCallable, Category="Actor")
3184 ENGINE_API bool IsChildActor() const;
3185
3187 ENGINE_API virtual bool IsSelectionParentOfAttachedActors() const;
3188
3190 ENGINE_API virtual bool IsSelectionChild() const;
3191
3193 ENGINE_API virtual AActor* GetSelectionParent() const;
3194
3196 ENGINE_API virtual AActor* GetRootSelectionParent() const;
3197
3199 ENGINE_API virtual bool SupportsSubRootSelection() const;
3200
3202 ENGINE_API bool IsActorOrSelectionParentSelected() const;
3203
3205 ENGINE_API virtual void PushSelectionToProxies();
3206
3207#if WITH_EDITOR
3210#endif
3211
3216 UFUNCTION(BlueprintCallable, Category="Actor")
3217 ENGINE_API void GetAllChildActors(TArray<AActor*>& ChildActors, bool bIncludeDescendants = true) const;
3218
3220 UFUNCTION(BlueprintCallable, Category="Actor")
3221 ENGINE_API UChildActorComponent* GetParentComponent() const;
3222
3224 UFUNCTION(BlueprintCallable, Category="Actor")
3225 ENGINE_API AActor* GetParentActor() const;
3226
3228 ENGINE_API virtual void RegisterAllComponents();
3229
3231 ENGINE_API virtual void PreRegisterAllComponents();
3232
3237 ENGINE_API virtual void PostRegisterAllComponents();
3238
3240 inline bool HasDeferredComponentRegistration() const { return bHasDeferredComponentRegistration; }
3241
3243 ENGINE_API bool HasValidRootComponent() const;
3244
3249 ENGINE_API virtual void UnregisterAllComponents(bool bForReregister = false);
3250
3252 ENGINE_API virtual void PostUnregisterAllComponents();
3253
3255 ENGINE_API virtual void ReregisterAllComponents();
3256
3258 ENGINE_API void HandleRegisterComponentWithWorld(UActorComponent* Component);
3259
3266 ENGINE_API bool IncrementalRegisterComponents(int32 NumComponentsToRegister, FRegisterComponentContext* Context = nullptr);
3267
3269 ENGINE_API void MarkComponentsRenderStateDirty();
3270
3272 ENGINE_API void UpdateComponentTransforms();
3273
3275 ENGINE_API void UpdateComponentVisibility();
3276
3278 ENGINE_API void InitializeComponents();
3279
3281 ENGINE_API void UninitializeComponents();
3282
3284 ENGINE_API void DrawDebugComponents(FColor const& BaseColor=FColor::White) const;
3285
3286
3287 UE_DEPRECATED(5.3, "Use MarkComponentsAsGarbage instead.")
3288 virtual void MarkComponentsAsPendingKill() { MarkComponentsAsGarbage(); }
3289
3294 ENGINE_API virtual void MarkComponentsAsGarbage(bool bModify = true);
3295
3301 inline bool IsPendingKillPending() const
3302 {
3303 return bActorIsBeingDestroyed || !IsValidChecked(this);
3304 }
3305
3308 {
3309 if (GIsEditor && !GIsDemoMode)
3310 {
3311 InvalidateLightingCacheDetailed(false);
3312 }
3313 }
3314
3316 ENGINE_API virtual void InvalidateLightingCacheDetailed(bool bTranslationOnly);
3317
3329 ENGINE_API virtual bool TeleportTo( const FVector& DestLocation, const FRotator& DestRotation, bool bIsATest=false, bool bNoCheck=false );
3330
3338 UFUNCTION(BlueprintCallable, meta=( DisplayName="Teleport", ScriptName="Teleport", Keywords = "Move Position" ), Category="Transformation")
3339 ENGINE_API bool K2_TeleportTo( FVector DestLocation, FRotator DestRotation );
3340
3342 virtual void TeleportSucceeded(bool bIsATest) {}
3343
3353 ENGINE_API bool ActorLineTraceSingle(struct FHitResult& OutHit, const FVector& Start, const FVector& End, ECollisionChannel TraceChannel, const struct FCollisionQueryParams& Params) const;
3354
3367 ENGINE_API float ActorGetDistanceToCollision(const FVector& Point, ECollisionChannel TraceChannel, FVector& ClosestPointOnCollision, UPrimitiveComponent** OutPrimitiveComponent = nullptr) const;
3368
3370 ENGINE_API bool IsInLevel(const class ULevel *TestLevel) const;
3371
3373 UFUNCTION(BlueprintCallable, Category=Level)
3374 ENGINE_API ULevel* GetLevel() const;
3375
3377 UFUNCTION(BlueprintCallable, Category=Level)
3378 ENGINE_API FTransform GetLevelTransform() const;
3379
3381 ENGINE_API virtual void ClearCrossLevelReferences();
3382
3384 ENGINE_API void RouteEndPlay(const EEndPlayReason::Type EndPlayReason);
3385
3391 ENGINE_API virtual bool IsBasedOnActor(const AActor* Other) const;
3392
3398 ENGINE_API virtual bool IsAttachedTo( const AActor* Other ) const;
3399
3401 ENGINE_API FVector GetPlacementExtent() const;
3402
3403
3404 //~=============================================================================
3405 // Blueprint
3406
3407#if WITH_EDITOR
3410#endif // WITH_EDITOR
3411
3413 ENGINE_API void ResetPropertiesForConstruction();
3414
3416 ENGINE_API bool HasNonTrivialUserConstructionScript() const;
3417
3418#if WITH_EDITOR
3420 ENGINE_API virtual void RerunConstructionScripts();
3421#endif
3422
3429
3432
3442 ENGINE_API bool ExecuteConstruction(const FTransform& Transform, const struct FRotationConversionCache* TransformRotationCache, const class FComponentInstanceDataCache* InstanceDataCache, bool bIsDefaultTransform = false, ESpawnActorScaleMethod TransformScaleMethod = ESpawnActorScaleMethod::OverrideRootScale);
3443
3448 virtual void OnConstruction(const FTransform& Transform) {}
3449
3454 ENGINE_API void FinishAndRegisterComponent(UActorComponent* Component);
3455
3457 ENGINE_API UActorComponent* CreateComponentFromTemplate(UActorComponent* Template, const FName InName = NAME_None );
3458 ENGINE_API UActorComponent* CreateComponentFromTemplateData(const struct FBlueprintCookedComponentInstancingData* TemplateData, const FName InName = NAME_None);
3459
3461 ENGINE_API void DestroyConstructedComponents();
3462
3464
3466 {
3467 };
3471 ENGINE_API virtual void FillReplicationParams(const FFillReplicationParamsContext& Context, FActorReplicationParams& OutParams);
3472
3473protected:
3474
3476 {
3477 };
3481 ENGINE_API virtual void OnReplicationStartedForIris(const FOnReplicationStartedParams&);
3482
3490 ENGINE_API virtual void OnStopReplicationForIris(const FOnStopReplicationParams&);
3491
3495 UE_DEPRECATED(5.7, "This is being deprecated as part of iris beta. Use OnReplicationStartedForIris or FillReplicationParams overrides instead.")
3496 ENGINE_API virtual void BeginReplication();
3497
3501 UE_DEPRECATED(5.7, "This is being deprecated as part of iris beta. Override OnStopReplicationForIris instead.")
3502 ENGINE_API virtual void EndReplication(EEndPlayReason::Type EndPlayReason);
3503
3508 UE_DEPRECATED(5.7, "This is being deprecated as part of iris beta. Do not call directly override FillReplicationParams instead to provide custom parameters.")
3509 ENGINE_API void BeginReplication(const FActorReplicationParams& Params);
3510
3515 ENGINE_API void UpdateOwningNetConnection();
3516
3517 friend struct UE::Net::FReplicationSystemUtil;
3518
3519
3523 ENGINE_API void UpdateReplicatePhysicsCondition();
3524
3525protected:
3530 ENGINE_API virtual void RegisterActorTickFunctions(bool bRegister);
3531
3533 ENGINE_API void ProcessUserConstructionScript();
3534
3536 ENGINE_API bool CheckActorComponents() const;
3537
3539 ENGINE_API void PostCreateBlueprintComponent(UActorComponent* NewActorComp);
3540
3541public:
3543 ENGINE_API void CheckComponentInstanceName(const FName InName);
3544
3546 UFUNCTION(BlueprintPure, Category = "Actor")
3547 ENGINE_API AActor* GetAttachParentActor() const;
3548
3550 UFUNCTION(BlueprintPure, Category = "Actor")
3551 ENGINE_API FName GetAttachParentSocketName() const;
3552
3554 ENGINE_API void ForEachAttachedActors(TFunctionRef<bool(class AActor*)> Functor) const;
3555
3557 UFUNCTION(BlueprintPure, Category = "Actor")
3558 ENGINE_API void GetAttachedActors(TArray<AActor*>& OutActors, bool bResetArray = true, bool bRecursivelyIncludeAttachedActors = false) const;
3559
3564 UFUNCTION(BlueprintCallable, Category="Actor|Tick", meta=(Keywords = "dependency"))
3565 ENGINE_API void SetTickGroup(ETickingGroup NewTickGroup);
3566
3569
3571 ENGINE_API void DispatchBlockingHit(UPrimitiveComponent* MyComp, UPrimitiveComponent* OtherComp, bool bSelfMoved, FHitResult const& Hit);
3572
3574 ENGINE_API virtual void FellOutOfWorld(const class UDamageType& dmgType);
3575
3577 ENGINE_API virtual void OutsideWorldBounds();
3578
3584 ENGINE_API virtual FBox GetComponentsBoundingBox(bool bNonColliding = false, bool bIncludeFromChildActors = false) const;
3585
3591 ENGINE_API virtual FBox CalculateComponentsBoundingBoxInLocalSpace(bool bNonColliding = false, bool bIncludeFromChildActors = false) const;
3592
3598 ENGINE_API virtual void GetComponentsBoundingCylinder(float& CollisionRadius, float& CollisionHalfHeight, bool bNonColliding = false, bool bIncludeFromChildActors = false) const;
3599
3604 ENGINE_API virtual void GetSimpleCollisionCylinder(float& CollisionRadius, float& CollisionHalfHeight) const;
3605
3607 float GetSimpleCollisionRadius() const;
3608
3610 float GetSimpleCollisionHalfHeight() const;
3611
3613 FVector GetSimpleCollisionCylinderExtent() const;
3614
3616 ENGINE_API virtual bool IsRootComponentCollisionRegistered() const;
3617
3622 ENGINE_API virtual void TornOff();
3623
3624
3625 //~=============================================================================
3626 // Collision/Physics functions.
3627
3633 ENGINE_API virtual ECollisionResponse GetComponentsCollisionResponseToChannel(ECollisionChannel Channel) const;
3634
3636 ENGINE_API void DisableComponentsSimulatePhysics();
3637
3642 ENGINE_API class AWorldSettings* GetWorldSettings() const;
3643
3648 ENGINE_API virtual bool CanBeBaseForCharacter(class APawn* Pawn) const;
3649
3660
3661protected:
3662 ENGINE_API virtual float InternalTakeRadialDamage(float Damage, struct FRadialDamageEvent const& RadialDamageEvent, class AController* EventInstigator, AActor* DamageCauser);
3663 ENGINE_API virtual float InternalTakePointDamage(float Damage, struct FPointDamageEvent const& PointDamageEvent, class AController* EventInstigator, AActor* DamageCauser);
3664
3665public:
3667 ENGINE_API virtual void BecomeViewTarget( class APlayerController* PC );
3668
3670 ENGINE_API virtual void EndViewTarget( class APlayerController* PC );
3671
3673 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnBecomeViewTarget", ScriptName="OnBecomeViewTarget", Keywords="Activate Camera"), Category=Actor)
3674 ENGINE_API void K2_OnBecomeViewTarget( class APlayerController* PC );
3675
3677 UFUNCTION(BlueprintImplementableEvent, meta=(DisplayName="OnEndViewTarget", ScriptName="OnEndViewTarget", Keywords="Deactivate Camera"), Category=Actor)
3678 ENGINE_API void K2_OnEndViewTarget( class APlayerController* PC );
3679
3686 ENGINE_API virtual void CalcCamera(float DeltaTime, struct FMinimalViewInfo& OutResult);
3687
3689 ENGINE_API virtual bool HasActiveCameraComponent(bool bForceFindCamera = false) const;
3690
3692 ENGINE_API virtual bool HasActivePawnControlCameraComponent() const;
3693
3695 ENGINE_API virtual FString GetHumanReadableName() const;
3696
3698 ENGINE_API virtual void Reset();
3699
3701 UFUNCTION(BlueprintImplementableEvent, Category=Actor, meta=(DisplayName="OnReset", ScriptName="OnReset"))
3702 ENGINE_API void K2_OnReset();
3703
3711 UFUNCTION(Category="Rendering", BlueprintCallable, meta=(DisplayName="Was Actor Recently Rendered", Keywords="scene visible"))
3712 ENGINE_API bool WasRecentlyRendered(float Tolerance = 0.2f) const;
3713
3715 ENGINE_API virtual float GetLastRenderTime() const;
3716
3718 ENGINE_API virtual void ForceNetRelevant();
3719
3721 UFUNCTION( BlueprintCallable, Category="Networking")
3722 ENGINE_API virtual void ForceNetUpdate();
3723
3730 UFUNCTION(BlueprintCallable, Category = "Rendering")
3731 ENGINE_API virtual void PrestreamTextures( float Seconds, bool bEnableStreaming, int32 CinematicTextureGroups = 0 );
3732
3743 UFUNCTION(BlueprintCallable, Category = Actor)
3744 ENGINE_API virtual void GetActorEyesViewPoint( FVector& OutLocation, FRotator& OutRotation ) const;
3745
3750 ENGINE_API virtual FVector GetTargetLocation(AActor* RequestedBy = nullptr) const;
3751
3759 ENGINE_API virtual void PostRenderFor(class APlayerController* PC, class UCanvas* Canvas, FVector CameraPosition, FVector CameraDir);
3760
3762 ENGINE_API bool IsInPersistentLevel(bool bIncludeLevelStreamingPersistent = false) const;
3763
3765 ENGINE_API virtual UWorld* GetWorld() const override final;
3766
3768 ENGINE_API class FTimerManager& GetWorldTimerManager() const;
3769
3771 ENGINE_API class UGameInstance* GetGameInstance() const;
3772
3777 template< class T >
3778 T* GetGameInstance() const
3779 {
3780 return Cast<T>(GetGameInstance());
3781 }
3782
3784 ENGINE_API bool IsNetStartupActor() const;
3785
3787 ENGINE_API virtual UActorComponent* FindComponentByClass(const TSubclassOf<UActorComponent> ComponentClass) const;
3788
3790 UFUNCTION(BlueprintCallable, Category = "Actor", meta = (ComponentClass = "/Script/Engine.ActorComponent"), meta = (DeterminesOutputType = "ComponentClass"))
3791 ENGINE_API UActorComponent* GetComponentByClass(TSubclassOf<UActorComponent> ComponentClass) const;
3792
3794 template<class T>
3795 T* GetComponentByClass() const
3796 {
3797 return FindComponentByClass<T>();
3798 }
3799
3805 UFUNCTION(BlueprintCallable, Category = "Actor", meta = (ComponentClass = "/Script/Engine.ActorComponent", DisplayName = "Get Components By Class", ScriptName = "GetComponentsByClass", DeterminesOutputType = "ComponentClass"))
3806 ENGINE_API TArray<UActorComponent*> K2_GetComponentsByClass(TSubclassOf<UActorComponent> ComponentClass) const;
3807
3809 UFUNCTION(BlueprintCallable, Category = "Actor", meta = (ComponentClass = "/Script/Engine.ActorComponent"), meta = (DeterminesOutputType = "ComponentClass"))
3810 ENGINE_API UActorComponent* FindComponentByTag(TSubclassOf<UActorComponent> ComponentClass, FName Tag) const;
3811
3813 UFUNCTION(BlueprintCallable, Category = "Actor", meta = (ComponentClass = "/Script/Engine.ActorComponent"), meta = (DeterminesOutputType = "ComponentClass"))
3815
3817 ENGINE_API virtual UActorComponent* FindComponentByInterface(const TSubclassOf<UInterface> Interface) const;
3818
3820 UFUNCTION(BlueprintCallable, Category = "Actor")
3821 ENGINE_API TArray<UActorComponent*> GetComponentsByInterface(TSubclassOf<UInterface> Interface) const;
3822
3824 template<class T>
3825 T* FindComponentByClass() const
3826 {
3827 static_assert(TPointerIsConvertibleFromTo<T, const UActorComponent>::Value, "'T' template parameter to FindComponentByClass must be derived from UActorComponent");
3828
3829 return (T*)FindComponentByClass(T::StaticClass());
3830 }
3831
3833 template<class T>
3835 {
3836 static_assert(TPointerIsConvertibleFromTo<T, const UActorComponent>::Value, "'T' template parameter to FindComponentByTag must be derived from UActorComponent");
3837
3838 return (T*)FindComponentByTag(T::StaticClass(), Tag);
3839 }
3840
3842 template<class T UE_REQUIRES(TPointerIsConvertibleFromTo<T, UInterface>::Value)>
3843 UE_DEPRECATED(5.5, "This version incorrectly casts to the UInterface type used for reflection. Use FindComponentByInterface<IMyInterface>() instead")
3844 T* FindComponentByInterface() const
3845 {
3846 return (T*)FindComponentByInterface(T::StaticClass());
3847 }
3848
3850 template<class T UE_REQUIRES(TIsIInterface<T>::Value)>
3852 {
3853 return Cast<T>(FindComponentByInterface(T::UClassType::StaticClass()));
3854 }
3855
3856private:
3857
3863 template<class ComponentType, bool bClassIsActorComponent, bool bIncludeFromChildActors, typename Func>
3864 void ForEachComponent_Internal(TSubclassOf<UActorComponent> InComponentClass, Func InFunc) const
3865 {
3866 if (const UClass* ComponentClass = InComponentClass)
3867 {
3868 check(bClassIsActorComponent == false || ComponentClass == UActorComponent::StaticClass());
3869 check(ComponentClass->IsChildOf(ComponentType::StaticClass()));
3870
3871 // static check, so that the most common case (bIncludeFromChildActors) doesn't need to allocate an additional array :
3873 {
3875 for (UActorComponent* OwnedComponent : OwnedComponents)
3876 {
3877 if (OwnedComponent)
3878 {
3879 if (bClassIsActorComponent || OwnedComponent->IsA(ComponentClass))
3880 {
3881 InFunc(static_cast<ComponentType *>(OwnedComponent));
3882 }
3884 {
3885 if (AActor* ChildActor = ChildActorComponent->GetChildActor())
3886 {
3888 }
3889 }
3890 }
3891 }
3892
3894 {
3895 ChildActor->ForEachComponent_Internal<ComponentType, bClassIsActorComponent, bIncludeFromChildActors>(InComponentClass, InFunc);
3896 }
3897 }
3898 else
3899 {
3900 for (UActorComponent* OwnedComponent : OwnedComponents)
3901 {
3902 if (OwnedComponent)
3903 {
3904 if (bClassIsActorComponent || OwnedComponent->IsA(ComponentClass))
3905 {
3906 InFunc(static_cast<ComponentType *>(OwnedComponent));
3907 }
3908 }
3909 }
3910 }
3911 }
3912 }
3913
3918 template<class ComponentType, typename Func>
3919 void ForEachComponent_Internal(TSubclassOf<UActorComponent> ComponentClass, bool bIncludeFromChildActors, Func InFunc) const
3920 {
3921 static_assert(TPointerIsConvertibleFromTo<ComponentType, const UActorComponent>::Value, "'ComponentType' template parameter to ForEachComponent must be derived from UActorComponent");
3922 if (ComponentClass == UActorComponent::StaticClass())
3923 {
3925 {
3926 ForEachComponent_Internal<ComponentType, true /*bClassIsActorComponent*/, true /*bIncludeFromChildActors*/>(ComponentClass, InFunc);
3927 }
3928 else
3929 {
3930 ForEachComponent_Internal<ComponentType, true /*bClassIsActorComponent*/, false /*bIncludeFromChildActors*/>(ComponentClass, InFunc);
3931 }
3932 }
3933 else
3934 {
3936 {
3937 ForEachComponent_Internal<ComponentType, false /*bClassIsActorComponent*/, true /*bIncludeFromChildActors*/>(ComponentClass, InFunc);
3938 }
3939 else
3940 {
3941 ForEachComponent_Internal<ComponentType, false /*bClassIsActorComponent*/, false /*bIncludeFromChildActors*/>(ComponentClass, InFunc);
3942 }
3943 }
3944 }
3945
3946public:
3947
3953 template<class ComponentType, typename Func>
3955 {
3957 }
3958
3963 template<typename Func>
3965 {
3967 }
3968
3980 template<class AllocatorType, class ComponentType>
3982 {
3983 OutComponents.Reset();
3985 {
3986 OutComponents.Add(InComp);
3987 });
3988 }
3989
4000 template<class ComponentType, class AllocatorType>
4002 {
4004
4005 OutComponents.Reset();
4007 {
4008 OutComponents.Add(InComp);
4009 });
4010 }
4011
4022 template<class T, class AllocatorType>
4024 {
4025 // We should consider removing this function. It's not really hurting anything by existing but the one above it was added so that
4026 // we weren't assuming T*, preventing TObjectPtrs from working for this function. The only downside is all the people who force the
4027 // template argument with GetComponents's code suddenly not compiling with no clear error message.
4028
4029 OutComponents.Reset();
4031 {
4032 OutComponents.Add(InComp);
4033 });
4034 }
4035
4046 template<class T, class AllocatorType>
4048 {
4049 OutComponents.Reset();
4051 {
4052 OutComponents.Add(InComp);
4053 });
4054 }
4055
4067 template<class AllocatorType>
4076
4083 {
4084 return ObjectPtrDecay(OwnedComponents);
4085 }
4086
4092 ENGINE_API void AddOwnedComponent(UActorComponent* Component);
4093
4098 ENGINE_API void RemoveOwnedComponent(UActorComponent* Component);
4099
4100#if DO_CHECK || USING_CODE_ANALYSIS
4103#endif
4104
4109 ENGINE_API void ResetOwnedComponents();
4110
4112 ENGINE_API void UpdateReplicatedComponent(UActorComponent* Component);
4113
4115 ENGINE_API void UpdateAllReplicatedComponents();
4116
4125 ENGINE_API virtual ELifetimeCondition AllowActorComponentToReplicate(const UActorComponent* ComponentToReplicate) const;
4126
4131 ENGINE_API void SetReplicatedComponentNetCondition(const UActorComponent* ReplicatedComponent, ELifetimeCondition NetCondition);
4132
4134 inline bool GetIsReplicated() const
4135 {
4136 return bReplicates;
4137 }
4138
4141 {
4142 return ReplicatedComponents;
4143 }
4144
4151 ENGINE_API void AddReplicatedSubObject(UObject* SubObject, ELifetimeCondition NetCondition = COND_None);
4152
4160 ENGINE_API void RemoveReplicatedSubObject(UObject* SubObject);
4161
4169 ENGINE_API void DestroyReplicatedSubObjectOnRemotePeers(UObject* SubObject);
4170
4172 ENGINE_API void DestroyReplicatedSubObjectOnRemotePeers(UActorComponent* OwnerComponent, UObject* SubObject);
4173
4183 ENGINE_API void TearOffReplicatedSubObjectOnRemotePeers(UObject* SubObject);
4184
4186 ENGINE_API void TearOffReplicatedSubObjectOnRemotePeers(UActorComponent* OwnerComponent, UObject* SubObject);
4187
4194 ENGINE_API void AddActorComponentReplicatedSubObject(UActorComponent* OwnerComponent, UObject* SubObject, ELifetimeCondition NetCondition = COND_None);
4195
4200 ENGINE_API void RemoveActorComponentReplicatedSubObject(UActorComponent* OwnerComponent, UObject* SubObject);
4201
4203 ENGINE_API bool IsReplicatedSubObjectRegistered(const UObject* SubObject) const;
4204
4206 ENGINE_API bool IsReplicatedActorComponentRegistered(const UActorComponent* ReplicatedComponent) const;
4207
4209 ENGINE_API bool IsActorComponentReplicatedSubObjectRegistered(const UActorComponent* OwnerComponent, const UObject* SubObject) const;
4210
4211
4219
4226 static ENGINE_API const UActorComponent* GetActorClassDefaultComponent(const TSubclassOf<AActor>& InActorClass, const TSubclassOf<UActorComponent>& InComponentClass);
4227
4234 static ENGINE_API const UActorComponent* GetActorClassDefaultComponentByName(const TSubclassOf<AActor>& InActorClass, const TSubclassOf<UActorComponent>& InComponentClass, FName InComponentName);
4235
4242 static ENGINE_API void ForEachComponentOfActorClassDefault(const TSubclassOf<AActor>& InActorClass, const TSubclassOf<UActorComponent>& InComponentClass, TFunctionRef<bool(const UActorComponent*)> InFunc);
4243
4250 {
4251 ForEachComponentOfActorClassDefault(InActorClass, TComponentClass::StaticClass(), [&](const UActorComponent* TemplateComponent)
4252 {
4254 return true;
4255 });
4256 }
4257
4264 {
4265 return Cast<TComponentClass>(GetActorClassDefaultComponent(InActorClass, TComponentClass::StaticClass()));
4266 }
4267
4274 {
4275 return Cast<TComponentClass>(GetActorClassDefaultComponentByName(InActorClass, TComponentClass::StaticClass(), InComponentName));
4276 }
4277
4284 {
4285 ForEachComponentOfActorClassDefault(InActorClass, TComponentClass::StaticClass(), [&](const UActorComponent* TemplateComponent)
4286 {
4288 });
4289 }
4290
4291private:
4293 UE::Net::FSubObjectRegistry ReplicatedSubObjects;
4295
4297 TArray<UE::Net::FReplicatedComponentInfo> ReplicatedComponentsInfo;
4298
4300 ENGINE_API bool RemoveReplicatedSubObjectFromList(UObject* SubObject);
4301
4303 ENGINE_API bool RemoveActorComponentReplicatedSubObjectFromList(UActorComponent* OwnerComponent, UObject* SubObject);
4304
4306 ENGINE_API void AddComponentForReplication(UActorComponent* Component);
4307
4309 ENGINE_API void RemoveReplicatedComponent(UActorComponent* Component);
4310
4312 ENGINE_API void BuildReplicatedComponentsInfo();
4313
4314protected:
4317
4318private:
4323 TSet<TObjectPtr<UActorComponent>> OwnedComponents;
4324
4325#if WITH_EDITOR
4328#endif
4329
4331 UPROPERTY(Instanced)
4332 TArray<TObjectPtr<UActorComponent>> InstanceComponents;
4333
4334public:
4336 UPROPERTY(TextExportTransient, NonTransactional)
4337 TArray<TObjectPtr<UActorComponent>> BlueprintCreatedComponents;
4338
4340 ENGINE_API void AddInstanceComponent(UActorComponent* Component);
4341
4343 ENGINE_API void RemoveInstanceComponent(UActorComponent* Component);
4344
4346 ENGINE_API void ClearInstanceComponents(bool bDestroyComponents);
4347
4349 ENGINE_API const TArray<UActorComponent*>& GetInstanceComponents() const;
4350
4351#if WITH_EDITOR
4353#endif
4354
4355 //~=============================================================================
4356 // Navigation/AI related functions
4357
4369 UFUNCTION(BlueprintCallable, BlueprintAuthorityOnly, Category="AI", meta=(BlueprintProtected = "true"))
4370 ENGINE_API void MakeNoise(float Loudness=1.f, APawn* NoiseInstigator=nullptr, FVector NoiseLocation=FVector::ZeroVector, float MaxRange = 0.f, FName Tag = NAME_None);
4371
4373 static ENGINE_API void MakeNoiseImpl(AActor* NoiseMaker, float Loudness, APawn* NoiseInstigator, const FVector& NoiseLocation, float MaxRange, FName Tag);
4374
4376 static ENGINE_API void SetMakeNoiseDelegate(const FMakeNoiseDelegate& NewDelegate);
4377
4382 virtual bool IsComponentRelevantForNavigation(UActorComponent* Component) const { return true; }
4383
4384private:
4385 static ENGINE_API FMakeNoiseDelegate MakeNoiseDelegate;
4386
4387
4388public:
4389 //~=============================================================================
4390 // Debugging functions
4391
4405 ENGINE_API virtual void DisplayDebug(class UCanvas* Canvas, const class FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos);
4406
4408 static FString GetDebugName(const AActor* Actor) { return Actor ? Actor->GetName() : TEXT("NULL"); }
4409
4410#if !UE_BUILD_SHIPPING
4413#endif
4414
4415#if !UE_STRIP_DEPRECATED_PROPERTIES
4417 UE_DEPRECATED(5.1, "AActor::DetachFence has been deprecated. If you are relying on it for render thread synchronization in a subclass of actor, add your own fence to that class instead.")
4419#endif
4420
4421private:
4423 ENGINE_API void InternalDispatchBlockingHit(UPrimitiveComponent* MyComp, UPrimitiveComponent* OtherComp, bool bSelfMoved, FHitResult const& Hit);
4424
4426 ENGINE_API ENetMode InternalGetNetMode() const;
4427
4429 ENGINE_API bool InternalPostEditUndo();
4430
4435#if WITH_EDITOR
4436 ENGINE_API bool IsActorFolderValid() const;
4440
4441 friend struct FSetActorHiddenInSceneOutliner;
4442 friend struct FSetActorGuid;
4443 friend struct FSetActorReplicates;
4444 friend struct FSetActorInstanceGuid;
4445 friend struct FSetActorContentBundleGuid;
4446 friend struct FAssignActorDataLayer;
4447 friend struct FSetActorSelectable;
4448 friend struct FSetActorFolderPath;
4449#endif
4450
4451 // Static helpers for accessing functions on SceneComponent.
4452 // These are templates for no other reason than to delay compilation until USceneComponent is defined.
4453
4454 template<class T>
4455 static inline const FTransform& TemplateGetActorTransform(const T* RootComponent)
4456 {
4457 return (RootComponent != nullptr) ? RootComponent->GetComponentTransform() : FTransform::Identity;
4458 }
4459
4460 template<class T>
4461 static inline FVector TemplateGetActorLocation(const T* RootComponent)
4462 {
4463 return (RootComponent != nullptr) ? RootComponent->GetComponentLocation() : FVector::ZeroVector;
4464 }
4465
4466 template<class T>
4467 static inline FRotator TemplateGetActorRotation(const T* RootComponent)
4468 {
4469 return (RootComponent != nullptr) ? RootComponent->GetComponentRotation() : FRotator::ZeroRotator;
4470 }
4471
4472 template<class T>
4473 static inline FVector TemplateGetActorScale(const T* RootComponent)
4474 {
4475 return (RootComponent != nullptr) ? RootComponent->GetComponentScale() : FVector(1.f,1.f,1.f);
4476 }
4477
4478 template<class T>
4479 static inline FQuat TemplateGetActorQuat(const T* RootComponent)
4480 {
4481 return (RootComponent != nullptr) ? RootComponent->GetComponentQuat() : FQuat(ForceInit);
4482 }
4483
4484 template<class T>
4485 static inline FVector TemplateGetActorForwardVector(const T* RootComponent)
4486 {
4487 return (RootComponent != nullptr) ? RootComponent->GetForwardVector() : FVector::ForwardVector;
4488 }
4489
4490 template<class T>
4491 static inline FVector TemplateGetActorUpVector(const T* RootComponent)
4492 {
4493 return (RootComponent != nullptr) ? RootComponent->GetUpVector() : FVector::UpVector;
4494 }
4495
4496 template<class T>
4497 static inline FVector TemplateGetActorRightVector(const T* RootComponent)
4498 {
4499 return (RootComponent != nullptr) ? RootComponent->GetRightVector() : FVector::RightVector;
4500 }
4501
4502 //~ Begin Methods for Replicated Members.
4503public:
4504
4511 {
4512 return GET_MEMBER_NAME_CHECKED(AActor, bHidden);
4513 }
4514
4521 bool IsHidden() const
4522 {
4523 return bHidden;
4524 }
4525
4531 ENGINE_API void SetHidden(const bool bInHidden);
4532
4539 {
4540 return GET_MEMBER_NAME_CHECKED(AActor, bReplicateMovement);
4541 }
4542
4550 {
4551 return bReplicateMovement;
4552 }
4553
4555 ENGINE_API void SetReplicatingMovement(bool bInReplicateMovement);
4556
4563 {
4564 return GET_MEMBER_NAME_CHECKED(AActor, bCanBeDamaged);
4565 }
4566
4573 bool CanBeDamaged() const
4574 {
4575 return bCanBeDamaged;
4576 }
4577
4579 ENGINE_API void SetCanBeDamaged(bool bInCanBeDamaged);
4580
4587 {
4588 return GET_MEMBER_NAME_CHECKED(AActor, Role);
4589 }
4590
4594 ENGINE_API void SetRole(ENetRole InRole);
4595
4603 {
4604 return ReplicatedMovement;
4605 }
4606
4613 ENGINE_API FRepMovement& GetReplicatedMovement_Mutable();
4614
4616 ENGINE_API void SetReplicatedMovement(const FRepMovement& InReplicatedMovement);
4617
4621 UFUNCTION(BlueprintSetter)
4622 ENGINE_API void SetNetUpdateFrequency(float Frequency);
4623
4627 UFUNCTION(BlueprintGetter)
4628 ENGINE_API float GetNetUpdateFrequency() const;
4629
4633 UFUNCTION(BlueprintSetter)
4634 ENGINE_API void SetMinNetUpdateFrequency(float MinFrequency);
4635
4639 UFUNCTION(BlueprintGetter)
4640 ENGINE_API float GetMinNetUpdateFrequency() const;
4641
4645 UFUNCTION(BlueprintSetter)
4646 ENGINE_API void SetNetCullDistanceSquared(float DistanceSq);
4647
4651 UFUNCTION(BlueprintGetter)
4652 ENGINE_API float GetNetCullDistanceSquared() const;
4653
4660 {
4661 return GET_MEMBER_NAME_CHECKED(AActor, Instigator);
4662 }
4663
4665 ENGINE_API void SetInstigator(APawn* InInstigator);
4666
4669 {
4670 bActorIsPendingPostNetInit = bInIsPendingPostNetInit;
4671 }
4672
4673 //~ End Methods for Replicated Members.
4674};
4675
4678{
4679private:
4681 {
4682 InActor->bActorIsBeingDestroyed = true;
4683 }
4684
4685 friend UWorld;
4686};
4687
4690{
4691private:
4693 {
4694 ensure(InActor->IsActorBeginningPlay()); // Doesn't make sense to call this under any other circumstances
4695 InActor->bActorWantsDestroyDuringBeginPlay = true;
4696 }
4697
4698 friend UWorld;
4699};
4700
4701
4702inline void FActorLastRenderTime::Set(AActor* InActor, float LastRenderTime)
4703{
4704 InActor->LastRenderTime.SetLastRenderTime(LastRenderTime);
4705}
4706
4707inline FActorLastRenderTime* FActorLastRenderTime::GetPtr(AActor* InActor)
4708{
4709 return (InActor ? &InActor->LastRenderTime : nullptr);
4710}
4711
4714{
4715private:
4716 static void IncrementalPreRegisterComponents(AActor* InActor)
4717 {
4718 InActor->IncrementalPreRegisterComponents();
4719 }
4720
4721 static bool HasPreRegisteredAllComponents(const AActor* InActor)
4722 {
4723 return InActor->HasPreRegisteredAllComponents();
4724 }
4725
4726 static void IncrementalPreUnregisterComponents(AActor* InActor)
4727 {
4728 InActor->IncrementalPreUnregisterComponents();
4729 }
4730 friend class ULevel;
4731};
4732
4733#if WITH_EDITOR
4735{
4736private:
4737 FSetActorHiddenInSceneOutliner(AActor* InActor, bool bHidden = true)
4738 {
4739 InActor->bListedInSceneOutliner = !bHidden;
4740 }
4741
4742 friend UWorld;
4743 friend class FFoliageHelper;
4744 friend class ULevelInstanceSubsystem;
4745 friend class UExternalDataLayerInstance;
4747};
4748
4749struct FSetActorGuid
4750{
4751private:
4753 {
4754 InActor->ActorGuid = InActorGuid;
4755 }
4756 friend class UWorld;
4757 friend class UEngine;
4758 friend class UExternalActorsCommandlet;
4759 friend class UWorldPartitionConvertCommandlet;
4760};
4761
4763{
4764private:
4766 {
4767 if (InActor->bReplicates != bInReplicates)
4768 {
4769 check(!InActor->bActorInitialized);
4770 InActor->bReplicates = bInReplicates;
4772 }
4773 }
4774 friend class FWorldPartitionLevelHelper;
4775};
4776
4778{
4779private:
4781 {
4782 InActor->ActorInstanceGuid = InActorInstanceGuid;
4783 if (InActorInstanceGuid == InActor->ActorGuid)
4784 {
4785 InActor->ActorInstanceGuid.Invalidate();
4786 }
4787 }
4788 friend class UEngine;
4789 friend class ULevelStreamingLevelInstance;
4790 friend class FWorldPartitionLevelHelper;
4792};
4793
4795{
4796private:
4798 {
4799 InActor->SetFolderPathInternal(InFolderPath, bInBroadcastChange);
4800 }
4801 friend class UWorldPartitionRuntimeCell;
4802};
4803
4805{
4806private:
4808 {
4809 InActor->ContentBundleGuid = InContentBundleGuid;
4810 }
4811 friend class FContentBundleEditor;
4812 friend class FExternalDataLayerHelper;
4813 friend class UGameFeatureActionConvertContentBundleWorldPartitionBuilder;
4814};
4815
4817{
4818private:
4821
4822 friend class UEngine;
4823 friend class FContentBundleEditor;
4824 friend class UDataLayerInstanceWithAsset;
4825 friend class UDataLayerInstancePrivate;
4826 friend class UExternalDataLayerInstance;
4827 friend class ULevelInstanceSubsystem;
4828 friend class FExternalDataLayerHelper;
4829 friend class UActorPartitionSubsystem;
4830};
4831
4833{
4834private:
4836 {
4837 InActor->LevelInstanceType = InLevelInstanceType;
4838 }
4839
4840 friend class ULevelStreamingLevelInstance;
4843};
4844
4846{
4847private:
4849 {
4850 EnumAddFlags(InActor->LevelInstanceFlags, InFlagsToAdd);
4851 }
4852
4853 friend class ULevelStreamingLevelInstance;
4856};
4857
4859{
4860private:
4862 {
4863 EnumRemoveFlags(InActor->LevelInstanceFlags, InFlagsToRemove);
4864 }
4865
4866 friend class ULevelStreamingLevelInstance;
4869};
4870#endif
4871
4873template <typename ExecuteTickLambda>
4874void FActorComponentTickFunction::ExecuteTickHelper(UActorComponent* Target, bool bTickInEditor, float DeltaTime, ELevelTick TickType, const ExecuteTickLambda& ExecuteTickFunc)
4875{
4876 if (IsValid(Target))
4877 {
4880
4881 if (Target->bRegistered)
4882 {
4884 if (TickType != LEVELTICK_ViewportsOnly || bTickInEditor ||
4885 (MyOwner && MyOwner->ShouldTickIfViewportsOnly()))
4886 {
4887 const float TimeDilation = (MyOwner ? MyOwner->CustomTimeDilation : 1.f);
4888 ExecuteTickFunc(DeltaTime * TimeDilation);
4889 }
4890 }
4891 }
4892}
4893
4894template<class T, uint32 NumElements>
4896 : Super()
4897{
4898 if (Actor)
4899 {
4900 Actor->GetComponents(*this, bIncludeFromChildActors);
4901 }
4902};
4903
4905// Inlines
4906
4908{
4909 return GetActorLocation();
4910}
4911
4913{
4914 return GetActorRotation();
4915}
4916
4917inline USceneComponent* AActor::K2_GetRootComponent() const
4918{
4919 return GetRootComponent();
4920}
4921
4923{
4924 return TemplateGetActorForwardVector(ToRawPtr(RootComponent));
4925}
4926
4928{
4929 return TemplateGetActorUpVector(ToRawPtr(RootComponent));
4930}
4931
4933{
4934 return TemplateGetActorRightVector(ToRawPtr(RootComponent));
4935}
4936
4937
4939{
4940 float Radius, HalfHeight;
4941 GetSimpleCollisionCylinder(Radius, HalfHeight);
4942 return Radius;
4943}
4944
4946{
4947 float Radius, HalfHeight;
4948 GetSimpleCollisionCylinder(Radius, HalfHeight);
4949 return HalfHeight;
4950}
4951
4953{
4954 float Radius, HalfHeight;
4955 GetSimpleCollisionCylinder(Radius, HalfHeight);
4956 return FVector(Radius, Radius, HalfHeight);
4957}
4958
4960{
4961 return bActorEnableCollision;
4962}
4963
4964inline bool AActor::HasAuthority() const
4965{
4966 return (GetLocalRole() == ROLE_Authority);
4967}
4968
4970{
4971 return Owner;
4972}
4973
4974inline const AActor* AActor::GetNetOwner() const
4975{
4976 // NetOwner is the Actor Owner unless otherwise overridden (see PlayerController/Pawn/Beacon)
4977 // Used in ServerReplicateActors
4978 return Owner;
4979}
4980
4982{
4983 return RemoteRole;
4984}
4985
4987{
4988 // IsRunningDedicatedServer() is a compile-time check in optimized non-editor builds.
4990 {
4991 // Only normal net driver actors can have this optimization
4992 return NM_DedicatedServer;
4993 }
4994
4995 return InternalGetNetMode();
4996}
4997
4998inline bool AActor::IsNetMode(ENetMode Mode) const
4999{
5000#if UE_EDITOR
5001 // Editor builds are special because of PIE, which can run a dedicated server without the app running with -server.
5002 return GetNetMode() == Mode;
5003#else
5004 // IsRunningDedicatedServer() is a compile-time check in optimized non-editor builds.
5005 if (Mode == NM_DedicatedServer)
5006 {
5007 return IsRunningDedicatedServer();
5008 }
5010 {
5011 // Only normal net driver actors can have this optimization
5012 return !IsRunningDedicatedServer() && (InternalGetNetMode() == Mode);
5013 }
5014 else
5015 {
5016 return (InternalGetNetMode() == Mode);
5017 }
5018#endif
5019}
5020
5021#if WITH_EDITOR
5024#endif
5025
5027
5029// Macro to hide common Transform functions in native code for classes where they don't make sense.
5030// Note that this doesn't prevent access through function calls from parent classes (ie an AActor*), but
5031// does prevent use in the class that hides them and any derived child classes.
5032
5033#define HIDE_ACTOR_TRANSFORM_FUNCTIONS() private: \
5034 FTransform GetTransform() const { return Super::GetTransform(); } \
5035 FTransform GetActorTransform() const { return Super::GetActorTransform(); } \
5036 FVector GetActorLocation() const { return Super::GetActorLocation(); } \
5037 FRotator GetActorRotation() const { return Super::GetActorRotation(); } \
5038 FQuat GetActorQuat() const { return Super::GetActorQuat(); } \
5039 FVector GetActorScale() const { return Super::GetActorScale(); } \
5040 bool SetActorTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorTransform(NewTransform, bSweep, OutSweepHitResult, Teleport); } \
5041 bool SetActorLocation(const FVector& NewLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorLocation(NewLocation, bSweep, OutSweepHitResult, Teleport); } \
5042 bool SetActorRotation(FRotator NewRotation, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorRotation(NewRotation, Teleport); } \
5043 bool SetActorRotation(const FQuat& NewRotation, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorRotation(NewRotation, Teleport); } \
5044 bool SetActorLocationAndRotation(FVector NewLocation, FRotator NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorLocationAndRotation(NewLocation, NewRotation, bSweep, OutSweepHitResult, Teleport); } \
5045 bool SetActorLocationAndRotation(FVector NewLocation, const FQuat& NewRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { return Super::SetActorLocationAndRotation(NewLocation, NewRotation, bSweep, OutSweepHitResult, Teleport); } \
5046 virtual bool TeleportTo( const FVector& DestLocation, const FRotator& DestRotation, bool bIsATest, bool bNoCheck ) override { return Super::TeleportTo(DestLocation, DestRotation, bIsATest, bNoCheck); } \
5047 virtual FVector GetVelocity() const override { return Super::GetVelocity(); } \
5048 float GetHorizontalDistanceTo(AActor* OtherActor) { return Super::GetHorizontalDistanceTo(OtherActor); } \
5049 float GetVerticalDistanceTo(AActor* OtherActor) { return Super::GetVerticalDistanceTo(OtherActor); } \
5050 float GetDotProductTo(AActor* OtherActor) { return Super::GetDotProductTo(OtherActor); } \
5051 float GetHorizontalDotProductTo(AActor* OtherActor) { return Super::GetHorizontalDotProductTo(OtherActor); } \
5052 float GetDistanceTo(AActor* OtherActor) { return Super::GetDistanceTo(OtherActor); } \
5053 float GetSquaredDistanceTo(const AActor* OtherActor) { return Super::GetSquaredDistanceTo(OtherActor); } \
5054 FVector GetActorForwardVector() const { return Super::GetActorForwardVector(); } \
5055 FVector GetActorUpVector() const { return Super::GetActorUpVector(); } \
5056 FVector GetActorRightVector() const { return Super::GetActorRightVector(); } \
5057 void GetActorBounds(bool bOnlyCollidingComponents, FVector& Origin, FVector& BoxExtent, bool bIncludeFromChildActors = false) const { return Super::GetActorBounds(bOnlyCollidingComponents, Origin, BoxExtent, bIncludeFromChildActors); } \
5058 void SetActorScale3D(FVector NewScale3D) { Super::SetActorScale3D(NewScale3D); } \
5059 FVector GetActorScale3D() const { return Super::GetActorScale3D(); } \
5060 void SetActorRelativeScale3D(FVector NewRelativeScale) { Super::SetActorRelativeScale3D(NewRelativeScale); } \
5061 FVector GetActorRelativeScale3D() const { return Super::GetActorRelativeScale3D(); } \
5062 FTransform ActorToWorld() const { return Super::ActorToWorld(); } \
5063 void AddActorWorldOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorWorldOffset(DeltaLocation, bSweep, OutSweepHitResult, Teleport); } \
5064 void AddActorWorldRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorWorldRotation(DeltaRotation, bSweep, OutSweepHitResult, Teleport); } \
5065 void AddActorWorldRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorWorldRotation(DeltaRotation, bSweep, OutSweepHitResult, Teleport); } \
5066 void AddActorWorldTransform(const FTransform& DeltaTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorWorldTransform(DeltaTransform, bSweep, OutSweepHitResult, Teleport); } \
5067 void AddActorLocalOffset(FVector DeltaLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorLocalOffset(DeltaLocation, bSweep, OutSweepHitResult, Teleport); } \
5068 void AddActorLocalRotation(FRotator DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorLocalRotation(DeltaRotation, bSweep, OutSweepHitResult, Teleport); } \
5069 void AddActorLocalRotation(const FQuat& DeltaRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorLocalRotation(DeltaRotation, bSweep, OutSweepHitResult, Teleport); } \
5070 void AddActorLocalTransform(const FTransform& NewTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::AddActorLocalTransform(NewTransform, bSweep, OutSweepHitResult, Teleport); } \
5071 void SetActorRelativeLocation(FVector NewRelativeLocation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::SetActorRelativeLocation(NewRelativeLocation, bSweep, OutSweepHitResult, Teleport); } \
5072 void SetActorRelativeRotation(FRotator NewRelativeRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::SetActorRelativeRotation(NewRelativeRotation, bSweep, OutSweepHitResult, Teleport); } \
5073 void SetActorRelativeRotation(const FQuat& NewRelativeRotation, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::SetActorRelativeRotation(NewRelativeRotation, bSweep, OutSweepHitResult, Teleport); } \
5074 void SetActorRelativeTransform(const FTransform& NewRelativeTransform, bool bSweep=false, FHitResult* OutSweepHitResult=nullptr, ETeleportType Teleport = ETeleportType::None) { Super::SetActorRelativeTransform(NewRelativeTransform, bSweep, OutSweepHitResult, Teleport); }
ESpawnActorScaleMethod
Definition Actor.h:85
ELevelInstanceFlags
Definition Actor.h:105
EActorUpdateOverlapsMethod
Definition Actor.h:71
ELevelInstanceType
Definition Actor.h:96
#define check(expr)
Definition AssertionMacros.h:314
#define GET_MEMBER_NAME_CHECKED(ClassName, MemberName)
Definition AssertionMacros.h:493
#define ensure( InExpression)
Definition AssertionMacros.h:464
bool GIsDemoMode
Definition CoreGlobals.cpp:471
#define GIsEditor
Definition CoreGlobals.h:233
@ ForceInit
Definition CoreMiscDefines.h:155
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
bool IsRunningDedicatedServer()
Definition CoreMisc.h:152
ELifetimeCondition
Definition CoreNetTypes.h:20
@ COND_None
Definition CoreNetTypes.h:21
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_SixParams(DelegateName, Param1Type, Param2Type, Param3Type, Param4Type, Param5Type, Param6Type)
Definition DelegateCombinations.h:93
#define DECLARE_MULTICAST_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:49
#define DECLARE_DELEGATE_RetVal_ThreeParams(ReturnValueType, DelegateName, Param1Type, Param2Type, Param3Type)
Definition DelegateCombinations.h:72
#define DECLARE_EVENT_TwoParams(OwningType, EventName, Param1Type, Param2Type)
Definition DelegateCombinations.h:60
T * ToRawPtr(const TObjectPtr< T > &Ptr)
Definition ObjectPtr.h:1000
DIRECTLINK_API Display
Definition DirectLinkLog.h:8
EInputEvent
Definition EngineBaseTypes.h:31
ENetMode
Definition EngineBaseTypes.h:937
@ NM_DedicatedServer
Definition EngineBaseTypes.h:942
ETickingGroup
Definition EngineBaseTypes.h:84
ELevelTick
Definition EngineBaseTypes.h:70
@ LEVELTICK_ViewportsOnly
Definition EngineBaseTypes.h:74
ETeleportType
Definition EngineTypes.h:2401
ENetRole
Definition EngineTypes.h:3346
EAttachmentRule
Definition EngineTypes.h:62
ENetDormancy
Definition EngineTypes.h:3361
EPhysicsReplicationMode
Definition EngineTypes.h:3378
ESpawnActorCollisionHandlingMethod
Definition EngineTypes.h:4170
EDetachmentRule
Definition EngineTypes.h:112
ECollisionChannel
Definition EngineTypes.h:1088
ECollisionResponse
Definition EngineTypes.h:1240
constexpr bool EnumHasAnyFlags(Enum Flags, Enum Contains)
Definition EnumClassFlags.h:35
constexpr void EnumRemoveFlags(Enum &Flags, Enum FlagsToRemove)
Definition EnumClassFlags.h:98
constexpr void EnumAddFlags(Enum &Flags, Enum FlagsToAdd)
Definition EnumClassFlags.h:91
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
return true
Definition ExternalRpcRegistry.cpp:601
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#define FVector
Definition IOSSystemIncludes.h:8
UE_FORCEINLINE_HINT uint32 GetPtr() const
Definition LockFreeList.h:15
#define DECLARE_LOG_CATEGORY_EXTERN(CategoryName, DefaultVerbosity, CompileTimeVerbosity)
Definition LogMacros.h:361
UE::Math::TQuat< double > FQuat
Definition MathFwd.h:50
const bool
Definition NetworkReplayStreaming.h:178
#define UPROPERTY(...)
UObject definition macros.
Definition ObjectMacros.h:744
#define UPARAM(...)
Definition ObjectMacros.h:748
uint32 ERenameFlags
Definition ObjectMacros.h:2302
#define REN_None
Definition ObjectMacros.h:2305
#define GENERATED_BODY(...)
Definition ObjectMacros.h:765
#define UFUNCTION(...)
Definition ObjectMacros.h:745
#define UCLASS(...)
Definition ObjectMacros.h:776
#define UENUM(...)
Definition ObjectMacros.h:749
typename TPointedToTypeImpl< T >::Type TPointedToType
Definition ObjectPtr.h:1354
const U & ObjectPtrDecay(const T &Value)
Definition ObjectPtr.h:1744
bool IsValidChecked(const UObject *Test)
Definition Object.h:1886
USkinnedMeshComponent float
Definition SkinnedMeshComponent.h:60
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FiveParams(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name)
Definition SparseDelegate.h:450
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_NineParams(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name, Param7Type, Param7Name, Param8Type, Param8Name, Param9Type, Param9Name)
Definition SparseDelegate.h:454
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_TwoParams(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name)
Definition SparseDelegate.h:447
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_OneParam(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name)
Definition SparseDelegate.h:446
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_FourParams(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name)
Definition SparseDelegate.h:449
#define DECLARE_DYNAMIC_MULTICAST_SPARSE_DELEGATE_SevenParams(SparseDelegateClass, OwningClass, DelegateName, Param1Type, Param1Name, Param2Type, Param2Name, Param3Type, Param3Name, Param4Type, Param4Name, Param5Type, Param5Name, Param6Type, Param6Name, Param7Type, Param7Name)
Definition SparseDelegate.h:452
TStringView< TCHAR > FStringView
Definition StringFwd.h:45
EDataValidationResult
Definition UObjectGlobals.h:4225
uint32 Offset
Definition VulkanMemory.cpp:4033
#define DEFINE_ACTORDESC_TYPE(ActorType, ActorDescType)
Definition WorldPartitionActorDescType.h:36
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Actor.h:257
FString GetActorNameOrLabel() const
Definition Actor.h:1209
bool HasActorBegunPlay() const
Definition Actor.h:2148
FVector GetActorLocation() const
Definition Actor.h:2495
static const TComponentClass * GetActorClassDefaultComponent(const TSubclassOf< AActor > &InActorClass)
Definition Actor.h:4263
FVector GetActorUpVector() const
Definition Actor.h:4927
virtual const AActor * GetNetOwner() const
Definition Actor.h:4974
void InvalidateLightingCache()
Definition Actor.h:3307
static const FName GetInstigatorPropertyName()
Definition Actor.h:4659
virtual void OnNetCleanup(class UNetConnection *Connection)
Definition Actor.h:2875
bool IsPendingKillPending() const
Definition Actor.h:3301
virtual bool UseShortConnectTimeout() const
Definition Actor.h:2863
static const TComponentClass * GetActorClassDefaultComponentByName(const TSubclassOf< AActor > &InActorClass, FName InComponentName)
Definition Actor.h:4273
USceneComponent * GetRootComponent() const
Definition Actor.h:2474
bool IsRunningUserConstructionScript() const
Definition Actor.h:1042
void GetComponents(TArray< ComponentType, AllocatorType > &OutComponents, bool bIncludeFromChildActors=false) const
Definition Actor.h:4001
virtual USceneComponent * GetDefaultAttachComponent() const
Definition Actor.h:2480
FRotator K2_GetActorRotation() const
Definition Actor.h:4912
bool HasAuthority() const
Definition Actor.h:4964
static void ForEachComponentOfActorClassDefault(const TSubclassOf< AActor > &InActorClass, TFunctionRef< bool(const TComponentClass *)> InFunc)
Definition Actor.h:4283
ENetRole GetLocalRole() const
Definition Actor.h:739
bool IsActorBeginningPlayFromLevelStreaming() const
Definition Actor.h:2151
void GetComponents(TArray< T *, AllocatorType > &OutComponents, bool bIncludeFromChildActors=false) const
Definition Actor.h:4023
FVector GetSimpleCollisionCylinderExtent() const
Definition Actor.h:4952
FQuat GetActorQuat() const
Definition Actor.h:2513
FVector GetActorScale() const
Definition Actor.h:2507
static const FName GetHiddenPropertyName()
Definition Actor.h:4510
bool IsHidden() const
Definition Actor.h:4521
FVector GetActorRightVector() const
Definition Actor.h:4932
bool IsReplicatingMovement() const
Definition Actor.h:4549
virtual void OnActorChannelOpen(class FInBunch &InBunch, class UNetConnection *Connection)
Definition Actor.h:2856
bool GetIsReplicated() const
Definition Actor.h:4134
virtual bool IsLevelBoundsRelevant() const
Definition Actor.h:2558
bool HasActorRegisteredAllComponents() const
Definition Actor.h:2164
static ENGINE_API FOnProcessEvent ProcessEventDelegate
Definition Actor.h:4412
FRotator GetActorRotation() const
Definition Actor.h:2501
void GetComponents(TSubclassOf< UActorComponent > ComponentClass, TArray< ComponentType *, AllocatorType > &OutComponents, bool bIncludeFromChildActors=false) const
Definition Actor.h:3981
const FTransform & ActorToWorld() const
Definition Actor.h:1564
bool GetTearOff() const
Definition Actor.h:380
ENGINE_API void DebugShowComponentHierarchy(const TCHAR *Info, bool bShowPosition=true)
FTimerHandle TimerHandle_LifeSpanExpired
Definition Actor.h:1004
const TSet< UActorComponent * > & GetComponents() const
Definition Actor.h:4082
FStringView GetActorLabelView() const
Definition Actor.h:1220
ENetMode GetNetMode() const
Definition Actor.h:4986
virtual void PreDuplicateFromRoot(FObjectDuplicationParameters &DupParams)
Definition Actor.h:2448
static void GetActorClassDefaultComponents(const TSubclassOf< AActor > &InActorClass, TArray< const TComponentClass * > &OutComponents)
Definition Actor.h:4249
USceneComponent * K2_GetRootComponent() const
Definition Actor.h:4917
bool CanBeDamaged() const
Definition Actor.h:4573
void GetComponents(TArray< TObjectPtr< T >, AllocatorType > &OutComponents, bool bIncludeFromChildActors=false) const
Definition Actor.h:4047
void GetComponents(TArray< UActorComponent *, AllocatorType > &OutComponents, bool bIncludeFromChildActors=false) const
Definition Actor.h:4068
AActor * GetOwner() const
Definition Actor.h:4969
TArray< UActorComponent * > ReplicatedComponents
Definition Actor.h:4316
UFUNCTION(BlueprintCallable, Category="Actor", meta=(ComponentClass="/Script/Engine.ActorComponent"), meta=(DeterminesOutputType="ComponentClass")) ENGINE_API UActorComponent *GetComponentByClass(TSubclassOf< UActorComponent > ComponentClass) const
void ForEachComponent(bool bIncludeFromChildActors, Func InFunc) const
Definition Actor.h:3964
bool AllowReceiveTickEventOnDedicatedServer() const
Definition Actor.h:1039
FName NetDriverName
Definition Actor.h:814
float GetSimpleCollisionHalfHeight() const
Definition Actor.h:4945
float GetSimpleCollisionRadius() const
Definition Actor.h:4938
T * FindComponentByTag(const FName &Tag) const
Definition Actor.h:3834
bool IsNetMode(ENetMode Mode) const
Definition Actor.h:4998
TObjectPtr< AActor > Owner
Definition Actor.h:802
const FRepMovement & GetReplicatedMovement() const
Definition Actor.h:4602
void ForEachComponent(bool bIncludeFromChildActors, Func InFunc) const
Definition Actor.h:3954
TObjectPtr< USceneComponent > RootComponent
Definition Actor.h:995
static const FName GetCanBeDamagedPropertyName()
Definition Actor.h:4562
static const FName GetRolePropertyName()
Definition Actor.h:4586
ENGINE_API void DebugShowOneComponentHierarchy(USceneComponent *SceneComp, int32 &NestLevel, bool bShowPosition)
ENetRole GetRemoteRole() const
Definition Actor.h:4981
virtual ENGINE_API void GetSimpleCollisionCylinder(float &CollisionRadius, float &CollisionHalfHeight) const
Definition Actor.cpp:2140
const FTransform & GetActorTransform() const
Definition Actor.h:2489
bool GetActorEnableCollision() const
Definition Actor.h:4959
bool IsUsingRegisteredSubObjectList() const
Definition Actor.h:941
void SetHasActorRegisteredAllComponents()
Definition Actor.h:2167
virtual bool IsRuntimeOnly() const
Definition Actor.h:2367
T * FindComponentByInterface() const
Definition Actor.h:3851
virtual void OnSerializeNewActor(class FOutBunch &OutBunch)
Definition Actor.h:2869
virtual bool IsEditorOnlyLoadedInPIE() const
Definition Actor.h:2366
FVector GetActorForwardVector() const
Definition Actor.h:4922
static const FName GetReplicateMovementPropertyName()
Definition Actor.h:4538
FVector K2_GetActorLocation() const
Definition Actor.h:4907
bool IsOwnedBy(const AActor *TestOwner) const
Definition Actor.h:2463
const TArray< UActorComponent * > & GetReplicatedComponents() const
Definition Actor.h:4140
virtual void OnConstruction(const FTransform &Transform)
Definition Actor.h:3448
void SetActorIsPendingPostNetInit(bool bInIsPendingPostNetInit)
Definition Actor.h:4668
bool IsActorBeginningPlay() const
Definition Actor.h:2145
static FString GetDebugName(const AActor *Actor)
Definition Actor.h:4408
Definition Controller.h:41
Definition PhysicsVolume.h:17
Definition PlayerController.h:261
Definition WorldDataLayers.h:85
Definition Engine.Build.cs:7
Definition Archive.h:1208
Definition AssetRegistryTagsContext.h:98
Definition ComponentInstanceDataCache.h:217
Definition CoreNet.h:578
Definition DataValidation.h:40
Definition DisplayDebugHelpers.h:9
Definition ExternalDataLayerHelper.h:32
Definition FoliageHelper.h:12
Definition DataBunch.h:127
Definition NameTypes.h:617
Definition UObjectGlobals.h:1292
Definition ObjectSaveContext.h:554
Definition ObjectSaveContext.h:244
Definition ObjectSaveContext.h:535
Definition UnrealType.h:3087
Definition DataBunch.h:24
Definition PropertyPairsMap.h:13
Definition UnrealType.h:174
Definition UObjectGlobals.h:2492
Definition ActorComponent.h:47
Definition RenderCommandFence.h:15
Definition UObjectBaseUtility.h:1144
Definition Text.h:385
Definition TimerManager.h:133
Definition TransactionObjectEvent.h:181
Definition WorldPartitionActorDesc.h:282
Definition WorldPartitionLevelHelper.h:23
Definition CoreNet.h:570
Definition WorldPartitionRuntimeCellInterface.h:19
Definition Array.h:670
Definition EnumAsByte.h:22
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition Actor.h:203
TInlineComponentArray()
Definition Actor.h:207
TInlineComponentArray(const AActor *Actor, bool bIncludeFromChildActors=false)
Definition Actor.h:4895
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SubclassOf.h:30
Definition UniquePtr.h:107
Definition ActorChannel.h:78
Definition ActorComponent.h:152
virtual UObject const * AdditionalStatObject() const
Definition ActorComponent.h:1205
AActor * GetOwner() const
Definition ActorComponent.h:1534
uint8 bRegistered
Definition ActorComponent.h:225
Definition ActorFolder.h:17
Definition ActorPartitionSubsystem.h:88
Definition Canvas.h:159
Definition Class.h:3793
Definition DataLayer.h:52
Definition DamageType.h:21
Definition DataLayerAsset.h:30
Definition DataLayerInstancePrivate.h:11
Definition ReplicationFragment.h:244
Definition NetSubObjectRegistryGetter.h:15
Definition Engine.h:711
Definition ExternalDataLayerAsset.h:16
Definition Class.h:2476
Definition GameInstance.h:152
Definition HLODLayer.h:43
Definition InputComponent.h:729
Definition Interface.h:19
Definition LevelInstanceSubsystem.h:55
Definition LevelInstanceEditorPropertyOverrideLevelStreaming.h:20
Definition LevelInstanceEditorLevelStreaming.h:16
Definition LevelInstanceLevelStreaming.h:21
Definition Level.h:423
Definition NetConnection.h:284
Definition NetDriver.h:799
ENGINE_API void ForcePropertyCompare(AActor *Actor)
Definition NetDriver.cpp:4788
UE_FORCEINLINE_HINT FString GetName() const
Definition UObjectBaseUtility.h:439
virtual COREUOBJECT_API bool CanBeInCluster() const
Definition UObjectClusters.cpp:922
COREUOBJECT_API bool IsPackageExternal() const
Definition UObjectBaseUtility.cpp:152
Definition Object.h:95
virtual COREUOBJECT_API bool NeedsLoadForTargetPlatform(const class ITargetPlatform *TargetPlatform) const
Definition Obj.cpp:1007
virtual COREUOBJECT_API void PreSaveRoot(FObjectPreSaveRootContext ObjectSaveContext)
Definition Obj.cpp:1519
virtual COREUOBJECT_API void PostNetReceive()
Definition Obj.cpp:5896
virtual bool CallRemoteFunction(UFunction *Function, void *Parms, struct FOutParmRec *OutParms, FFrame *Stack)
Definition Object.h:1523
virtual COREUOBJECT_API bool Rename(const TCHAR *NewName=nullptr, UObject *NewOuter=nullptr, ERenameFlags Flags=REN_None)
Definition Obj.cpp:245
virtual void PostEditImport()
Definition Object.h:686
virtual COREUOBJECT_API void PreNetReceive()
Definition Obj.cpp:5890
virtual bool IsReadyForFinishDestroy()
Definition Object.h:373
virtual COREUOBJECT_API void PostRename(UObject *OldOuter, const FName OldName)
Definition Obj.cpp:891
virtual COREUOBJECT_API void BeginDestroy()
Definition Obj.cpp:1071
virtual COREUOBJECT_API bool IsAsset() const
Definition Obj.cpp:2704
virtual COREUOBJECT_API void PostSaveRoot(FObjectPostSaveRootContext ObjectSaveContext)
Definition Obj.cpp:1523
virtual int32 GetFunctionCallspace(UFunction *Function, FFrame *Stack)
Definition Object.h:1509
virtual COREUOBJECT_API bool IsNameStableForNetworking() const
Definition Obj.cpp:5942
virtual bool IsEditorOnly() const
Definition Object.h:593
virtual COREUOBJECT_API void RegisterReplicationFragments(UE::Net::FFragmentRegistrationContext &Context, UE::Net::EFragmentRegistrationFlags RegistrationFlags)
Definition Obj.cpp:5885
virtual COREUOBJECT_API void GetAssetRegistryTags(FAssetRegistryTagsContext Context) const
Definition Obj.cpp:2423
virtual COREUOBJECT_API void ProcessEvent(UFunction *Function, void *Parms)
Definition ScriptCore.cpp:2015
static COREUOBJECT_API void AddReferencedObjects(UObject *InThis, FReferenceCollector &Collector)
Definition GarbageCollection.cpp:6401
virtual COREUOBJECT_API void PostInitProperties()
Definition UObjectGlobals.cpp:3961
virtual COREUOBJECT_API void PostLoadSubobjects(FObjectInstancingGraph *OuterInstanceGraph)
Definition Obj.cpp:1428
UE_FORCEINLINE_HINT bool Modify(bool bAlwaysMarkDirty=true)
Definition Object.h:317
virtual COREUOBJECT_API bool CheckDefaultSubobjectsInternal() const
Definition Obj.cpp:2222
virtual COREUOBJECT_API bool IsSupportedForNetworking() const
Definition Obj.cpp:5961
Definition Package.h:216
Definition Player.h:18
Definition WorldPartitionRuntimeCell.h:236
Definition World.h:918
Definition EngineTypes.h:164
Definition EngineTypes.h:3397
Definition EngineTypes.h:3429
Type
Definition EngineTypes.h:3431
Definition InputCoreTypes.h:255
Definition SceneManagement.h:73
Definition NetworkVersion.cpp:28
EFragmentRegistrationFlags
Definition ReplicationFragment.h:220
Definition AdvancedWidgetsModule.cpp:13
Definition WorldPartition.cpp:74
@ false
Definition radaudio_common.h:23
Definition Actor.h:3484
const FStopReplicatingActorParams & StopReplicatingParams
Definition Actor.h:3485
Definition InputCoreTypes.h:290
class UActorComponent * Target
Definition EngineBaseTypes.h:578
static void ExecuteTickHelper(UActorComponent *Target, bool bTickInEditor, float DeltaTime, ELevelTick TickType, const ExecuteTickLambda &ExecuteTickFunc)
Definition Actor.h:4874
Definition ActorDataLayer.h:16
Definition Actor.h:134
friend class UPrimitiveComponent
Definition Actor.h:158
std::atomic< float > LastRenderTime
Definition Actor.h:136
std::atomic_int32_t NumAlwaysVisibleComponents
Definition Actor.h:152
void SetLastRenderTime(float InLastRenderTime)
Definition Actor.h:138
float GetLastRenderTime() const
Definition Actor.h:145
Definition ChildActorComponent.h:251
Definition Actor.h:4714
Definition EngineReplicationBridge.h:48
Definition EngineBaseTypes.h:526
Definition EngineTypes.h:75
Definition BlueprintGeneratedClass.h:345
Definition EngineTypes.h:1867
Definition CollisionQueryParams.h:43
Definition Color.h:486
static CORE_API const FColor White
Definition Color.h:749
Definition DamageEvents.h:16
Definition EngineTypes.h:122
Definition Folder.h:18
Definition Stack.h:114
Definition Guid.h:109
bool IsValid() const
Definition Guid.h:318
Definition HitResult.h:21
Definition InputCoreTypes.h:50
Definition Actor.h:4678
Definition CameraTypes.h:37
Definition WorldSettings.h:244
Definition NetworkObjectList.h:35
Definition UObjectGlobals.h:147
Definition Class.h:4941
Definition Stack.h:103
Definition DamageEvents.h:50
Definition PrimitiveSceneInfo.cpp:197
Definition UnrealType.h:6865
Definition DamageEvents.h:129
Definition ReplicatedState.h:34
Definition ReplicatedState.h:119
Definition EngineTypes.h:3601
Definition ResourceArray.h:31
Definition PhysicsPublic.h:62
Definition EngineTypes.h:1955
Definition SoftObjectPath.h:56
Definition EngineReplicationBridge.h:76
uint8 bCanEverTick
Definition EngineBaseTypes.h:204
Definition TimerHandle.h:12
Definition UObjectMigrationContext.h:62
Definition IsContiguousContainer.h:16
static constexpr bool Value
Definition IsContiguousContainer.h:20
Definition ObjectPtr.h:488
Definition PointerIsConvertibleFromTo.h:60
Definition SoftObjectPtr.h:174
Definition WeakObjectPtrTemplates.h:25
static CORE_API const TRotator< double > ZeroRotator
Definition Rotator.h:57
static CORE_API const TTransform< double > Identity
Definition TransformNonVectorized.h:58
static CORE_API const TVector< double > ZeroVector
Definition Vector.h:79
static CORE_API const TVector< double > ForwardVector
Definition Vector.h:91
static CORE_API const TVector< double > UpVector
Definition Vector.h:85
static CORE_API const TVector< double > RightVector
Definition Vector.h:97
Definition NetSubObjectRegistry.h:29