UE4 Scripting with C++_06

春道生

watching:Packt Publishing - Scripting Unreal Game Character                                                                                                     reading:冰与火之歌                                                                                                                                                                    watching:Packt Publishing - Mastering Unreal Engine 4.x Game Development

PS:本篇内容仅为个人参考,故省略一些名词                                                                                                                                               

快捷键:
ctrl+shift+B使用VS构建解决方案  
Alt+O 在.h与.cpp之间切换
alt+I快速生成function
删除不想要的Actor文件:
删掉相关的BP文件,关闭editor和VS,在工程目录中删除相关的.c和.h,选择ue project file
 文件重新生成vs解决方案
创建项目时VS占用高,是由于番茄插件导致的。。。
对于4.20版本创建MyCharacter的几点:
1、需要增加头文件
#include "GameFramework/SpringArmComponent.h"
#include "Camera/CameraComponent.h"
#include"Components/InputComponent.h"
2、
GetActorRightVector();可以直接使用,而不是Controller.Get的方式访问
3、相机的控制
PlayerInputComponent->BindAxis("Turn", this, &APawn::AddControllerYawInput);
PlayerInputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
turn为yaw,lookup为pitch
4、
在Charater_BP中设置首项Yaw为false,末项orith为true
准确的来说,学习阶段到底是没有用420的必要,资料支持的太少

对于需要增加的头文件:
shift+Alt+O即可寻找缺失的头文件

至此,需要熟练掌握的能力:C++创建character,与输入绑定控制

猜你喜欢

转载自blog.csdn.net/weixin_33232568/article/details/88764655