Ninja Input - 01 - Installation and Overview
Summary
TLDR本视频由Ninja Bear Studio的Uriel主讲,介绍了适用于Unreal Engine的Ninja输入插件。该插件旨在利用Unreal Engine 5.0及以上版本的增强输入系统来处理玩家输入。视频中,Uriel通过创建一个基于第三人称模板的新项目,展示了如何激活并使用Ninja输入插件来替代默认的输入处理代码。他详细解释了如何设置输入管理器组件、配置输入映射上下文和输入处理程序,以实现角色移动、摄像机控制和跳跃功能。最后,他清理了不再需要的原始输入动作,为进一步扩展功能做准备。
Takeaways
- 🎮 Ninja输入插件是为Unreal Engine Marketplace设计的,用于帮助处理使用增强输入功能的玩家输入。
- 🔧 插件通过更新第三人称模板来演示其基本功能,无需添加起始内容。
- 📈 从Unreal Engine 5.1开始,默认使用增强输入插件,但视频使用5.0版本展示如何启用。
- 🛠️ 通过插件标签激活增强输入和Ninjia输入插件,并重启引擎。
- ⚙️ 在项目设置中将增强输入设置为默认输入管理器,并在角色蓝图中移除预配置的输入处理代码。
- 🧩 向角色添加输入管理器组件,并设置输入上下文映射和移动处理器。
- 🔄 组件属性面板包含要跟踪的事件列表、注册的输入映射上下文和可用的处理程序。
- 👨💻 输入处理器是负责处理一个或多个映射输入动作的小段代码,可以跨角色或项目重用。
- 🎛️ 移动处理器具有特定的默认属性,例如动作和事件,这些属性决定了处理器的操作方式。
- 🔄 通过添加额外的处理程序,如查看处理器和角色跳跃处理器,恢复了所有原始输入功能。
- 🔧 在项目设置中删除不再需要的原始动作,为进一步扩展做准备。
Q & A
Ninja输入插件是为哪个游戏引擎设计的?
-Ninja输入插件是为Unreal Engine设计的。
在Unreal Engine中,如何启用增强输入插件?
-在Unreal Engine中,可以通过插件标签页找到增强输入插件,然后激活它。
为什么在视频中选择使用Unreal Engine 5.0而不是5.1?
-视频中使用Unreal Engine 5.0是为了展示如何在非默认情况下启用增强输入插件。
在Unreal Engine中,如何将增强输入设置为默认输入管理器?
-在项目设置窗口的输入类别中更改默认输入类即可。
Ninja输入插件中的输入管理器组件需要哪些属性才能工作?
-输入管理器组件需要设置输入上下文映射和移动处理器。
在Ninja输入插件中,输入映射上下文的作用是什么?
-输入映射上下文用于注册输入动作,定义了输入动作与特定输入事件的关联。
如何通过Ninja输入插件处理角色移动、视角旋转和跳跃?
-通过添加相应的输入处理器,如移动处理器、视角处理器和角色跳跃处理器,来处理这些输入。
在Ninja输入插件中,输入处理器的作用是什么?
-输入处理器是专门负责处理一个或多个映射输入动作的代码片段。
为什么在视频中移除了角色蓝图中预配置的输入处理代码?
-为了用Ninja输入插件重新创建输入处理功能,所以移除了原有的输入处理代码。
在视频中提到的'事件'、'输入映射上下文'和'输入处理器'分别是什么?
-事件是组件跟踪的输入动作,输入映射上下文是注册的输入动作集合,输入处理器是处理这些输入动作的代码。
在Ninja输入插件中,如何删除不再需要的原始输入动作?
-在项目设置的输入部分,可以删除不再需要的原始输入动作。
Outlines
🎮 Unreal Engine中的Ninja输入插件介绍
本段介绍了Ninja输入插件,这是一个用于Unreal Engine的插件,专门用于处理玩家输入。视频中通过更新第三人称模板来展示其基本功能。首先,创建一个基于第三人称模板的新项目,并命名为'Ninja input Labs'。在Unreal Engine 5.0版本中,虽然增强输入插件是默认的输入管理器,但视频中演示了如何激活它。接下来,通过项目设置将增强输入设置为默认输入管理器,并在角色蓝图中移除预配置的输入处理代码,准备使用Ninja输入插件重新创建这些功能。最后,向角色添加输入管理器组件,并设置输入上下文映射和移动处理器。通过这些步骤,角色能够再次响应输入,但还需要处理相机和跳跃按钮。
🔧 Ninja输入插件的事件和处理器配置
本段深入探讨了Ninja输入插件的事件跟踪、输入映射上下文和可用处理器。首先,组件需要跟踪一系列事件,这些事件由增强输入插件定义。输入映射上下文至少需要一个,以确定注册的优先级。数据资产中预配置了移动、查看和跳跃等输入动作。输入处理器是专门处理一个或多个映射输入动作的代码片段,可以跨多个角色或项目重用。例如,移动处理器具有特定的属性,如触发和持续事件,确保在任何移动输入按钮按下时每帧都执行。此外,还添加了查看处理器和角色跳跃处理器,它们也预配置了适当的输入动作和事件。通过这些配置,所有原始输入功能得以恢复,包括角色移动、相机旋转和跳跃。最后,视频中提到将在下一个视频中展示如何实现蹲伏和瞄准功能。
Mindmap
Keywords
💡Ninja输入插件
💡Unreal Engine
💡增强输入
💡蓝图
💡第三人称模板
💡输入管理器组件
💡输入上下文映射
💡输入处理程序
💡数据资产
💡项目设置
💡输入动作
Highlights
Ninja Input插件可帮助处理玩家输入,适用于Unreal Engine 5.0及更高版本。
通过第三人称模板展示如何使用Ninja Input插件处理玩家输入。
Unreal Engine 5.1及以上版本默认启用Enhanced Input插件。
演示了如何在Unreal Engine 5.0中手动启用Enhanced Input插件。
项目设置中需将Enhanced Input设置为默认输入管理器。
移除预设的输入代码,并使用Ninja Input插件重新创建输入功能。
如何为角色添加Ninja Input管理器组件以处理输入事件。
介绍如何访问Ninja Input插件的数据资产。
讲解如何使用预配置的输入映射上下文和移动处理器来实现角色移动。
介绍了输入事件列表、输入映射上下文和输入处理器的基本概念。
展示了如何通过输入处理器处理多个输入动作,如移动、查看和跳跃。
使用Ninja Input插件中的处理器可以在不同项目和角色之间复用代码。
演示了如何添加多个输入处理器来控制角色移动、旋转相机和跳跃功能。
展示了所有原始输入控制的重新实现,确保角色的移动、相机旋转和跳跃功能恢复正常。
最后清理了项目设置中的原始输入动作,为进一步扩展功能做好准备。
Transcripts
hello Uriel from Ninja bear Studio here
I'd like to give you an overview of the
Ninja input plugin that's available in
the Unreal Engine Marketplace
this plugin was built to help handling
player input while using the new
enhanced input from a real engine in the
source video let's look at some of its
basic features by updating the third
person template
let's get started by creating a new
project based on the third person
template using blueprints no need to add
the starter content I'll just name it
Ninja input Labs but feel free to name
it any way you'd like
regarding the engine version since 5.1
unreal uses the enhanced input plugin as
the default input manager but in this
video I'll be using 5.0 so we can check
how to enable that if necessary
now that we have our project let's hit
play and do a quick recap on what it
does we can move the character around
move the camera and jump as I mentioned
earlier the goal here is to replicate
this Behavior using the ninja input
the first thing we need to do is to go
to the plugins Tab and then look for the
enhanced input let us activate it and
don't worry about the beta message and
while we're here let us go ahead and
activate the ninjap input plugin too and
then restart the engine
now back in the project let's set the
enhanced input as the default input
manager to do that all we need to do is
to go to the project settings window
input category and then change the
default input classes
if we open our character blueprint we'll
find some code to handle the inputs that
are pre-configured in the project
we can simply remove them as we replace
them with our plugin
play our character won't respond to any
Keys which makes sense as we just
removed all the input handling code we
are ready to start recreating that
functionality using the ninja input so
let's add the input manager component to
the character
before going further we'll need to go to
the content browser and enable the
engine content that's necessary so we
can access some of the Ninja plugins
data assets
going back to the components properties
we'll find a few attributes in there and
we'll go through them soon enough
for now let's just set the input context
mapping provided by the plugin and the
move Handler
let's hit play one more time and see
what we just did the character is moving
again that's great but we still need to
do something about the camera and the
jump button those are still broken
first let's break down what just
happened there back to the component's
properties panel there are a few things
we should talk about
the first property is the list of events
that will be tracked then we have the
input mapping contexts that will be
registered and finally the available
handlers that our component can use
starting with the events these values
are defined by the enhanced input plugin
we are just telling our component that
we would like to track them so we can
forward input data to any related
handlers
as for the input mapping contexts the
component needs at least one it will
register them with enhanced input
subsystem using the order of entries as
their priority highest first
here if we open the data asset we
configured a moment ago we'll find that
it has a few pre-configured input
actions including move look and jump
which are the ones that we need don't
worry about the others for now
also keep in mind that we would usually
create a new input mapping context
specific to our project or even many but
for this quick example this one will
work just fine
back to the component's properties we
have the list of input handlers an input
Handler is a small piece of code solely
responsible for dealing with one or many
mapped input actions
we can have many of those and they can
be reused by multiple characters or
across different projects
if we expand the list we'll find a
collection of handlers available and you
can also create new ones
most handlers will have a few properties
that adjust the way they operate our
move Handler for example has some
specific and default properties
let's check the most important ones
the action is already mapped to the
proper data asset that was also
registered in our mapping context
the events are a subset of the once
tracked by the component itself that
would be applicable for our specific use
case
as you can see we have the triggered and
ongoing events so this Handler will
execute on each frame while any of the
movement input buttons are down
let's go ahead and add two more handlers
then the look Handler and the character
jump Handler
they are also pre-configured with the
proper input actions and events
if we hit play now all the original
inputs are functioning again as you can
see I can move the character rotate the
camera and jump
all these controls are being triggered
by the enhanced input system and handled
by the ninja input plugin
now that we made sure everything is
working as it should the last thing to
do in this video is to go back to our
project settings input and get rid of
the original actions as they are not
necessary anymore
great now we're ready to expand this
further and in the next video I like to
show you how to implement crouching and
aiming
see you soon
Ver Más Videos Relacionados
Unreal Engine 5 RPG Tutorial Series - #12: Target Lock and Dodge Roll
Unreal Engine 5 RPG Tutorial Series - #9: Combat
Unreal Engine 5 RPG Tutorial Series - #4: Assassinations
Python Advanced AI Agent Tutorial - LlamaIndex, Ollama and Multi-LLM!
How to Set Up an Unreal Engine 5 Git Repository - SourceTree Source Control
Keyboards & Command Line Interfaces: Crash Course Computer Science #22
5.0 / 5 (0 votes)