当前位置:网站首页>Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
Ue4- how to make a simple TPS role (II) - realize the basic movement of the role
2022-07-06 02:18:00 【qq_ twenty million seven thousand one hundred and seventy-one】
First open the project settings , Put the level scene we created , Set as editor default open map and game default map

At this time, we will find , The game mode we use is still the most basic gamemode, Next we need to create a dedicated game mode , Create a in the project path BluePrints Folder , Create a gamemode Blueprint file of type , And name it BP_TPS_GameMode

Double click to open the newly created BP_TPS_GameMode, Rotate on the right BP_TPS_GameModem, In the detail panel on the left, it defaults to pawn Class is modified to the one we just created TPS_Nova, Compile and save

Next, go back to the role blueprint just created TPS_Nova Open its event chart , At this time, we should start to write some blueprints to control the character movement

First, we get the rotation of the character controller , use Get Control Rotation, The object obtained is the role itself

Next, we split his rotation , use Break Rotator Get him x,y,z

Next, let's create a rotator to get the direction of the character's movement , use Make Rotator, And get the forward and right directions respectively

Next we use the input shaft , To get the user's operation input , Use inputaxis moveforward and inputaxis moveright Two blueprints , Create two acquisitions respectively add movement input

add movement input It is used to control the movement of characters , But he needs two parameters , One is the direction of movement , The other is the size of the motion value ( Used to control forward motion or reverse motion )
use inputaxis moveforward and inputaxis moveright The small green dots below transmit the size of the motion value to the mobile input , Pass the direction of vector value to the direction of motion
The last save , Click on the compilation , You can see the characters that can move freely in the level interface

At this time, we can't let the mobile camera , Control character rotation , Then we need to use add control yaw input To control the left and right rotation , And through inputaxis turn To get the input operation of the left and right movement of the mouse

After compiling , Run the game , Go to the corner of the world , Moving the mouse can control the movement of the character

Next, we can add upper limit rotation to the character , use add control pitch input This blueprint sets the up and down rotation of the character , use inputaxis lookup This event blueprint is used to get the up and down movement input of the mouse

After entering the game, I found , It seems to operate anyway , Characters can't rotate up and down , This time back to TPS_Nova The blueprint , Choose TPS_Nova Oneself , In the right detail panel , There is one pawn The option to , It uses the controller to rotate pitch,yaw,roll Options for three axes , Only yaw Checked , however pitch Not checked

Because we use control To control the protagonist , Therefore, you need to check the configuration that can be rotated , You will now pitch On the hook

Compile again , Enter the game , Control the mouse to move up , The character faces the sky

Control the mouse to move down , The character faces the earth 
This effect is completely different from the rotation control of other games , Because we control the character pitch The rotation of the shaft , and TPS The game uses a camera pitch The rotation of the shaft , Lead to different final results , We will solve this problem later
边栏推荐
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 零基础自学STM32-野火——GPIO复习篇——使用绝对地址操作GPIO
- A basic lintcode MySQL database problem
- [width first search] Ji Suan Ke: Suan tou Jun goes home (BFS with conditions)
- 论文笔记: 极限多标签学习 GalaXC (暂存, 还没学完)
- Initial understanding of pointer variables
- 模板_快速排序_双指针
- Install redis
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- Virtual machine network, networking settings, interconnection with host computer, network configuration
猜你喜欢

同一个 SqlSession 中执行两条一模一样的SQL语句查询得到的 total 数量不一样

Spark accumulator

Executing two identical SQL statements in the same sqlsession will result in different total numbers

Formatting occurs twice when vs code is saved
![[depth first search] Ji Suan Ke: Betsy's trip](/img/b5/f24eb28cf5fa4dcfe9af14e7187a88.jpg)
[depth first search] Ji Suan Ke: Betsy's trip

Redis string type

RDD partition rules of spark

Concept of storage engine

PHP campus movie website system for computer graduation design

Computer graduation design PHP part-time recruitment management system for College Students
随机推荐
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
The intelligent material transmission system of the 6th National Games of the Blue Bridge Cup
【MySQL 15】Could not increase number of max_open_files to more than 10000 (request: 65535)
genius-storage使用文档,一个浏览器缓存工具
Computer graduation design PHP part-time recruitment management system for College Students
leetcode3、实现 strStr()
Sword finger offer 38 Arrangement of strings
Redis如何实现多可用区?
机器学习训练与参数优化的一般过程 (讨论)
Blue Bridge Cup embedded_ STM32_ New project file_ Explain in detail
MySQL learning notes - subquery exercise
Visualstudio2019 compilation configuration lastools-v2.0.0 under win10 system
leetcode3、實現 strStr()
[width first search] Ji Suan Ke: Suan tou Jun goes home (BFS with conditions)
leetcode-2.回文判断
Leetcode sum of two numbers
Using SA token to solve websocket handshake authentication
Selenium waiting mode
How does redis implement multiple zones?
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]