编辑BP_GameMode

新建Actor命名为BP_SpectatingViewpoint

添加摄像机

将摄像机调整到合适的位置,右键选择

调整到合适的位置,点击这个按钮,退出驾驶模式

摄像机已经移动到合适的位置

回到BP_GameMode,在这一位置上设置了摄像机

给镜头移动添加慢动作,只需要修改参数

将上述逻辑连接断开,将用代码实现

在FPSGameMode头文件中新建变量

protected:
UPROPERTY(EditDefaultsOnly,Category="Spectating")
TSubclassOf<AActor> SpectatingViewpointClass;

在FPSGameMode的Cpp文件中修改CompleteMission函数

void AFPSGameMode::CompleteMission(APawn* InstigatorPawn)
{
if (InstigatorPawn)
{
InstigatorPawn->DisableInput(nullptr);
if (SpectatingViewpointClass)
{
TArray<AActor*> ReturnedActors;
UGameplayStatics::GetAllActorsOfClass(this, SpectatingViewpointClass, ReturnedActors);
//找到任何有效actor后,更改目标视角
if (ReturnedActors.Num() > )
{
AActor* NewViewTarget = ReturnedActors[];
APlayerController* PC = Cast<APlayerController>(InstigatorPawn->GetController());
if (PC)
{
PC->SetViewTargetWithBlend(NewViewTarget, 0.5f, EViewTargetBlendFunction::VTBlend_Cubic);
}
}
}
else
{
UE_LOG(LogTemp, Warning, TEXT("SpectatingViewpointClass is nullptr"));
}
}
OnMissionComplete(InstigatorPawn);
}

将之前建的变量赋值

Setup Post-mission Camera的更多相关文章

  1. Camera’s Depth Texture

    [Camera’s Depth Texture] In Unity a Camera can generate a depth or depth+normals texture. This is a ...

  2. Roomblock: a Platform for Learning ROS Navigation With Roomba, Raspberry Pi and RPLIDAR(转)

      What is this? "Roomblock" is a robot platform consists of a Roomba, a Raspberry Pi 2, a ...

  3. 翻译:GLSL的顶点位移贴图

    翻译:GLSL的顶点位移贴图 翻译自: Vertex Displacement Mapping using GLSL 译者: FreeBlues 说明: 之所以选择这篇文档, 是因为现在但凡提到位移贴 ...

  4. Photoshop CC (2015.2) 2016.1 版

    1.设计空间(预览版)增强 Design Space (Preview) 2.画板 3.Surface Pro触屏优化(多种手势) 4.自定义工具栏和工作区 5.字体收藏夹(要死掉一批扩展) 6.库( ...

  5. 初学WebGL引擎-BabylonJS:第8篇-阴影网格与活动

    [playground]-shadows(阴影) 源码 var createScene = function () { var scene = new BABYLON.Scene(engine); / ...

  6. Setup Mission End

    编写FPSGameMode 新建函数OnMissionComplete,并设置为蓝图可实现事件 UFUNCTION(BlueprintImplementableEvent,Category=" ...

  7. 【Android】Android Camera实时数据采集及通过MediaCodec硬编码编码数据的流程

    吐槽: 其实常用流程都差不多,但是有时候还是会忘记某一步的详细用法,但是各位朋友请注意,官方已经不推荐Camera类的使用(现在是android.hardware.camera2),但无奈公司项目之前 ...

  8. Android 创建自己的Camera App

    在sdk中找到/sdk/docs/guide/topics/media/camera.html#custom-camera,里面有详细的api参考 在清单文件中添加相应的权限: <uses-pe ...

  9. ACM-ICPC国际大学生程序设计竞赛北京赛区(2015)网络赛 B Mission Impossible 6

    #1228 : Mission Impossible 6 时间限制:1000ms 单点时限:1000ms 内存限制:256MB 描述 You must have seen the very famou ...

随机推荐

  1. 多元线性回归(Multivariate Linear Regression)简单应用

    警告:本文为小白入门学习笔记 数据集: http://openclassroom.stanford.edu/MainFolder/DocumentPage.php?course=DeepLearnin ...

  2. (二叉树 bfs) leetcode 199. Binary Tree Right Side View

    Given a binary tree, imagine yourself standing on the right side of it, return the values of the nod ...

  3. (replace find)nyoj113-字符串替换

    113-字符串替换 内存限制:64MB 时间限制:3000ms 特判: No通过数:171 提交数:388 难度:2 题目描述: 编写一个程序实现将字符串中的所有"you"替换成& ...

  4. vmstat命令详解

    一:简介 vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写,可对操作系统的虚拟内存.进程.CPU活动进行监控.他是对系统的整体情况进行统计,不足之处是无法对某个 ...

  5. flask学习之路

    目录 flask初识 flask模板 flask的session flask路由 flask配置和实例化传参 flask蓝图 更新中

  6. Redash 安装部署

    介绍 是一款开源的BI工具,提供了基于web的数据库查询和数据可视化功能. 官网:https://redash.io/ GitHub:https://github.com/getredash/reda ...

  7. FastDFS + Nginx代理方式访问

    FastDFS + Nginx代理方式访问 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.在storage上安装nginx 1>.下载nginx软件(http://ngi ...

  8. nginx之正向代理

    1.概述 nginx的正向代理,只能代理http.tcp等,不能代理https请求.有很多人不是很理解具体什么是nginx的正向代理.什么是反向代理.下面结合自己的使用做的一个简介: 1)正向代理: ...

  9. eclipse没有server选项

    摘录自:https://www.cnblogs.com/xiaoxiaoweng/p/7298183.html 问题描述:eclipse没有server选项 解决问题:找到Help->Insta ...

  10. Github/github 初始化教程

    注: 由于将项目迁移到gitee,克隆gitee 的时候出现了问题.不得已,重新配置 ref : https://blog.csdn.net/jingtingfengguo/article/detai ...