UPROPERTY(Meta = (BindWidget))
然后变量名字和蓝图的widget
UPROPERTY(Meta = (BindWidget))
然后变量名字和蓝图的widget
SceneCaptureCamera 需要改一下CaptureSource
然后高度始终设置成和玩家头上1200的噶偏低
删除C++文件
删除.vs intermediate
等重新生成.sln文件 然后打开
如果头像的相机进入头部里面
让相机跟着头部的骨骼移动
需要把相机绑定到mesh,并附带socket名称
initialize 中WidgetGetFromName可以获取相关控件
如果UE崩溃从构造函数中查找问题
如果编译不过去
.vs Binnaries Intermediate .sln文件右键删除
.uproject重新生成
1.自定义trancechannel,默认为ignore给land
1.主角的AI移动使用了AIModule
2.需要在.Buld.cs中添加该模块,在蓝图关卡中添加NavMesh Bounds
3.Decal贴花用来显示角色移动目标位置
4.ClassFinder不需要blurprint 和后缀比如:
Blueprint'/Game/Blueprints/BP_CursorDecal.BP_CursorDecal'
为:'/Game/Blueprints/BP_CursorDecal'
Project settings>Project>Maps&Modes>Default Maps
设置项目默认关卡
Scale右侧的锁可以让物体等比例缩放
按住鼠标右键,加上wsad可以像第一人称射击视角移动,e上升,q下降
Top视图,右键平移,左键框选,中键度量
Edit>Edit Preferences
设置编辑器偏好
Edit>Project Setting
项目设置,仅对当前项目生效
Level、Map、World指同一个东西,即关卡
Toolbar>Settings>World Settings
关卡设置,仅对当前关卡生效,并且会覆盖掉项目设置
在窗口>布局>加载布局>默认布局
可以恢复默认布局
cout << "hello"//输出
endl //换行 无法放在字符串中
\n //换行 可以放在字符串中
选中后先按ctrl+K 再按ctrl+C 是注释
按住ctrl+K 再按ctrl+U是取消注释
请问老师,测试时,人物移动到一半即返回,并且没有播放出攻击动作,可能是什么问题?
(人物移动到一半即返回的问题,可以通过在取montage的时长数据后再*2ji
overlap有两个条件:
1.是否可以碰撞;
2.允许重叠;
StopMovement和destroyDecalComponet。点击鼠标后清除上一次点击的鼠标贴花并取消上一次的移动任务。课时8
直接设置Actor的Zzhou位置更直接
hit碰撞事件,生成一个通道,贴画与材质碰撞,如果碰撞到,则生成贴画,否则就不生成
引用MainPlayer.h时,4.25版本下,写全目录报错。只需写#include "MainPlayer.h"即可。
练习题
1.int i;
for(i = 0; i < 5; i++)
cout << i;
cout << endl;
这段代码将输出:
01234
2.int j;
for(j = 0; j < 11; j += 3)
cout << j;
cout << endl << j << endl;
这段代码将输出:
0369
12
3.int j = 5;
while(++j < 9)
cout << j++ << endl;
这段代码将输出:
6
8
4.int k = 8;
do
cout << "k = " << k << endl;
while(k++ < 5);
这段代码将输出:
k = 8;
5.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int result = 1;
for (int i = 0; i < 7; i++)
{
cout << result << " ";
result *= 2;
}
}
6.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int a = 0;
int b = 0;
int total = 0;
cout << "Enter a number:";
cin >> a;
cout << "Enter another number that larger than first one:";
cin >> b;
for (; a <= b; a++) {
total += a;
}
cout << "The sum of integers between two numbers is:" << total << endl;
}
7.
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
int temp = 0;
int sum = 0;
cout << "Enter a number(Enter zero mean quit program):";
cin >> temp;
while (temp != 0) {
sum += temp;
cout << "Current sum is:" << sum << endl;
cout << "Enter a number(Enter zero mean quit program):";
cin >> temp;
}
}
多维数组
声明多维数组的基本结构如下:
int testArray[2][2]{
{11,22},
{33,44}
};
std::array<array<int, 2>,2> testArray2;
testArray2[0] = {{11,22}};
testArray2[1] = {{33,44}};
上述代码声明了一个2维数组testArray和testArray2,可以将第一个"[]"内的数字看做行数,第二个"[]"内的数字看做列数。
多维数组的声明和遍历操作如下:
#include <iostream>
#include <cstdio>
#include <string>
#include <array>
using namespace std;
int main()
{
array<int, 10> testArray{11,22,33,44,55,66,77,88,99,00};
array<int, 10> testArray2{22,33,44,55,66,77,88,99,00,11};
array<int, 10> testArray3{33,44,55,66,77,88,99,00,11,22};
array<array<int, 10>, 3> testArrayTotal;
testArrayTotal = { testArray, testArray2, testArray3 };
for (int i = 0; i < testArrayTotal.size();i++){
for (int j = 0; j < 10; j++){
cout << testArrayTotal[i][j] << "\n";
}
cout << "," << endl;
}
}