当创建一个继承Actor的蓝图类,想要在C++创建对应的Actor对象,并不能直接通过LoadObject来创建,因为LoadObject返回的是UBlueprint。我们需要先调用LoadClass,得到上面这个GeneratedClass,然后再调用SpawnActor来生成对应的Actor,SpawnActor做的事情就是将GeneratedClass传给NewObject来生成Actor。所以才会经常在其他地方看到那句...
只能是在spawn的时候,用那个return value这个键值,拿到炸弹的引用! 也就是说,关键在于,如何拿到引用。用【spawn actor】可以拿到这个引用,用吸管可以拿到引用。 () 例子已经解决了。但是,如果我想做这样一个功能: 尚未生出出来的子弹,如何在碰到敌人之后,给敌人一个30滴血量的damage,并且不用碰撞,而是用事件分发器...
创建等级属性 首先,玩家角色的等级需要创建在PlayerState里面,如果玩家角色Actor被销毁掉,等级信息也能够被保存下来。 UPROPERTY(VisibleAnywhere, ReplicatedUsing=OnRep_Level) int32 Level; 1. 2. 设置OnRep UFUNCTION() void OnRep_Level(int32 OldLevel); 1. 2. void APlayerStateBase::OnRep_Level(int32 Ol...
BlueprintGraph.K2Node_VariableGet Name="K2Node_VariableGet_0" VariableReference=(MemberParent=Class'"/Script/Engine.StaticMeshActor"',MemberName="StaticMeshComponent") SelfContextInfo=NotSelfContext NodePosX=384 NodePosY=-16 NodeGuid=40F429264E997CBFF58AF19950891B7C CustomProperties Pin (PinId=...
As静态网格体actor Target Static Mesh Component Target Static Mesh Save Loaded Asset Asset To Save Only If Is Dirty Return Value GET Remove Collisions Target Static Mesh Return Value /Script/Blueprint Graph.K2Node Get Editor Subsystem Fullscreen ...
Blueprintable 可被蓝图继承(AActor已声明) / NotBlueprintable BlueprintType 可用于蓝图的变量类型 Placeable 可通过编辑器放置到关卡/蓝图,可继承 NotPlaceable Deprecated 已弃用 UPROPERTY(...) UE类的属性宏 通过Unreal Header Tool来解析 只有通过 UCLASS 宏声明的类才能使用 UPROPERTY 宏 ...
UFUNCTION(BlueprintCallable) bool TestLoadPak(const FString& InPakFullPath); 1. 2. 3. 4. 在.cpp文件中引用头文件 #include "MyActor.h" #include "IPlatformFilePak.h" #include "HAL/PlatformFilemanager.h" #include "Runtime/Engine/Classes/Engine/StreamableManager.h" ...
UE个人笔记 · 16篇 TimelineFunctionLibrary.h #pragmaonce#include"CoreMinimal.h"#include"Kismet/BlueprintFunctionLibrary.h"#include"Curves/CurveFloat.h"#include"TimelineFunctionLibrary.generated.h"DECLARE_DYNAMIC_DELEGATE(FOnTimelineUpdate);DECLARE_DYNAMIC_DELEGATE(FOnTimelineFinished);USTRUCT(BlueprintType)...
2 TestCall_Source_TestMyClass_MyActor_h_12_GENERATED_BODY 3 UFUNCTION(BlueprintNativeEvent) image.png UHT对函数的3个类别支持 BlueprintCallable C++定义 蓝图调用 BlueprintNativeEvent C++定义 蓝图可覆盖 BlueprintImplementableEvent C++声明和调用 蓝图去实现 ...
“对比式”案例:用Unity的Prefab理解Unreal的Blueprint,用C#的MonoBehaviour类比C++的Actor,无缝衔接知识体系。 避坑指南:揭秘Unity开发者转型时最易踩的十大“思维陷阱”(如:过度依赖脚本、忽视蓝图协作),节省90%试错时间。 2. 双线并进:C++与蓝图的黄金平衡法则 ...