转自:http://aigo.iteye.com/blog/2270177

C++中创建一个Level并添加的Runtime当中

C++中Spawn一个基于蓝图的Actor

https://answers.unrealengine.com/questions/60897/spawn-actorobject-from-code.htm

Here is how I spawn a blueprint via C++. Note that the blueprint I spawn has a base class that was created in C++ also.

.h

.cpp(注意,这段代码必须放在构造函数中。UE4其他类型的蓝图,比如Widget蓝图,都可以通过下面这种方式加载。)

PutNameHere is just an arbitrary name you give to the constructor helper. The path to your blueprint is found by finding your blueprint in the content browser, right clicking it, and choosing Copy Reference. Then, just paste that in between the quotes.

Now, you're ready to spawn the blueprint. You can do it in BeginPlay() or wherever, just not in the constructor.(这段代码必须放在非构造函数中,比如BeginPlay()中

If you don't know your SpawnLocation or SpawnRotation you can just throw in FVector(0,0,0) and FRotator(0,0,0) instead.

So, since your blueprint base class was also created in C++ this makes it easy to interact with your blueprint from code. It's as simple as YC->SomeVariable = SomeValue. Hope that helps.

[UE4]C++中SpawnActor用法(动态创建Actor)的更多相关文章

  1. .Net 中的反射(动态创建类型实例) - Part.4

    动态创建对象 在前面节中,我们先了解了反射,然后利用反射查看了类型信息,并学习了如何创建自定义特性,并利用反射来遍历它.可以说,前面三节,我们学习的都是反射是什么,在接下来的章节中,我们将学习反射可以 ...

  2. .Net 中的反射(动态创建类型实例)

    动态创建对象 在前面节中,我们先了解了反射,然后利用反射查看了类型信息,并学习了如何创建自定义特性,并利用反射来遍历它.可以说,前面三节,我们学习的都是反射是什么,在接下来的章节中,我们将学习反射可以 ...

  3. js中几种动态创建元素并设置文本内容的比较,及性能测试。

    内容 1 appendChild (都兼容) 2.insertAdjacentHTML (都兼容) 3.innerHTML (都兼容) 4.createDocumentFragment (都兼容) 动 ...

  4. vue+el-element中根据文件名动态创建dialog的方法

    背景 在项目中使用对话框的通常做法是把对话框封装成组件,在使用的地方引入,然后添加到template,使用visible.sync控制对话框的显示/隐藏,监听confirm事件处理用户点击确定.如下: ...

  5. 在TFS中通过程序动态创建Bug并感知Bug解决状态

    为便于跟踪问题解决情况,预警引擎产生的比较严重的预警日志,需要在TFS中登记Bug,通过TFS的状态流转,利用TFS Bug的Web挂钩功能,动态感知Bug解决状态,从而跟踪预警问题的解决状态, 整体 ...

  6. elk搜集日志,实现logstash根据message中结构不同动态创建索引并扩展功能,区分message中json和非json数据简单方式

    搜集日志,但是框架本身也会打印很多日志是字符串的.我们自己希望的日志用json,但是又需要json字段可以扩展,logstash收集日志后都放在了message字段中,我们自定义打印的是json串,s ...

  7. Angular动态创建组件之Portals

    这篇文章主要介绍使用Angular api 和 CDK Portals两种方式实现动态创建组件,另外还会讲一些跟它相关的知识点,如:Angular多级依赖注入.ViewContainerRef,Por ...

  8. delphi里动态创建AlphaControls实现换肤

    AlphaControls是一套Delphi下的优秀的皮肤vcl控件.几年前,一般用得比较多的是vclskin,使用很方便,可惜这套2010年已经停止维护了.后来就看到更多的人开始推崇AlphaCon ...

  9. Winfrom动态创建控件

    FlowLayoutPanel flowLayoutPanel1 = new FlowLayoutPanel();for (int i = 0; i < 9; i++){    Button b ...

随机推荐

  1. 在CentOS 6上使用 AWStats 分析 httpd 和 Tomcat 日志

    准备工作: Awstats 是由perl语言编写的,所以要首先准备好awstats的运行环境.# yum install –y perl*   Apache 一.首先,要安装apache服务器,并且启 ...

  2. MySQL创建表,更新表,删除表,重命名表

    创建表 mysql> create table 表名( -> 列名 数据类型 是否为空 auto_increment, -> 列名 数据类型 是否为空... -> ... -& ...

  3. Spring Cloud Eureka Server使用(注册中心)

    一.Spring Cloud Eureka 基于Netflix Eureka做了二次封装 由两个组件组成 Eureka Server 注册中心, 供服务注册的服务器 Eureka Client 服务注 ...

  4. linux curl 命令的使用

    有时候需要内网访问接口地址,使用curl命令,带上-v参数 -v 参数可以显示一次 http 通信的整个过程,包括端口连接和 http request 头信息 curl -v http://172.9 ...

  5. golang查看channel缓冲区的长度

    golang提供内建函数cap用于查看channel缓冲区长度. cap的定义如下: func cap(v Type) int The cap built-in function returns th ...

  6. 12c R2 RAC Oracle Linux 7.3 ESXI6.5

    环境:ESXI6.5虚拟化 主机配置:操作系统 Oracle Linux 7.3 CPU:8个VCPU 内存:16G 本地磁盘:50G 全程默认最小化安装Oracle Linux 7.3操作系统 每个 ...

  7. Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(

    application.class要放在根目录下,否则会发生以下错误

  8. PxCook 像素大厨 标注切图,一起搞定!专注设计本质

    http://www.fancynode.com.cn/pxcook

  9. Tensorflow之基于MNIST手写识别的入门介绍

    Tensorflow是当下AI热潮下,最为受欢迎的开源框架.无论是从Github上的fork数量还是star数量,还是从支持的语音,开发资料,社区活跃度等多方面,他当之为superstar. 在前面介 ...

  10. phpmailer使用qq邮箱、163邮箱成功发送邮件实例代码

    以前使用qq邮箱.163服务器发送邮件,帐号直接使用密码,现在不行了,得使用授权码,简单记录下 1.首先开通POP3/SMTP服务,qq邮箱——帐号——设置,找到POP3/SMTP点开启,输入短信会有 ...