UE4 游戏路径动态改变和显示

效果:

做法:

创建actor,添加SplineCompent,也可以是SplineMeshComponent,在构造函数中从SplineComponent中获取所以的点,遍历,在Add Spline Mesh Component函数中指定路线的mesh,本案例中是一种动态黄色的材质

接着将mesh绑到SceneComponent上,根据Spline中不同点,获取该点的Location和Tangent,设置起点和终点

在场景中,放置两条SplineActor,想要拖出不同轨迹的路径,选中spline的端点,按住alt,选中鼠标左键即可将曲线拉长

最后,在关卡蓝图中根据不同情况显示和隐藏不同的SplineActor即可

猜你喜欢

转载自blog.csdn.net/zhangxiaofan666/article/details/87931939