- 博客(7)
- 收藏
- 关注
原创 UE4蓝图 绑定输入
在蓝图中绑定输入:在项目设定中设定绑定类型在蓝图中即可显示相关绑定3.最终效果附c++开启输入:一般情况下,Actor及其子类需要开启输入需要用到EnableInput()方法Actor.h/** * Pushes this actor on to the stack of input being handled by a PlayerController. * @param PlayerController The PlayerController whose input
2022-01-18 09:17:50 912
原创 UE4C++ 指定游戏或UI接受输入事件
在游戏过程中存在只需要UI接受输入事件的需求调用APlayerController::SetInputMode(const FInputModeDataBase& InData)来处理PlayerController.cpp/** Setup an input mode. */void APlayerController::SetInputMode(const FInputModeDataBase& InData){ UGameViewportClient* GameViewpo
2022-01-16 22:30:23 3480
原创 UE4C++ UI接受键盘/鼠标事件
UUserWidget.h把bIsFocusable 设置为true重写OnKeyDown() /** Setting this flag to true, allows this widget to accept focus when clicked, or when navigated to. */ UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Interaction") uint8 bIsFocusable : 1; /
2022-01-16 22:07:30 1699 1
原创 UE4C++ 组件调用射线检测
.h UFUNCTION() void StartLineTrace(); UPROPERTY() AActor* RootActor;};.cpp// Called when the game startsvoid ULineTraceComponent::BeginPlay(){ Super::BeginPlay(); // 绑定射线检测事件 if (RootActor==nullptr) { RootActor = GetAttachmentRootActor();
2021-12-15 11:42:12 1045
原创 UE4C++ Actor开启Input输入
UE4C++ Actor开启Input输入//引入UGameplayStatics的头文件,后续查找PlayerController#include "Kismet/GameplayStatics.h"// Called when the game starts or when spawnedvoid AClickTestActor::BeginPlay(){ Super::BeginPlay(); //获取PlayerController APlayerController* Playe
2021-12-14 10:08:42 1943 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人