spphins 发表于 2016-12-26 14:05:41

蓝图引用的问题

我在名为distance的蓝图中写如下的函数(计算两点空间距离)

在关卡蓝图中写了如下内容,其中引用了distance中的函数


New Var 0 就是引用的蓝图,左边眼睛点亮了


但是报错:
错误 Blueprint Runtime Error: Accessed None trying to read property NewVar_0 from function: 'ExecuteUbergraph_Minimal_Default' from node: F Distance in graph: EventGraph in object: Minimal_Default with description: Accessed None trying to read property NewVar_0


而且输出的数值是0

printscreen 发表于 2016-12-26 14:33:48

直接distance to节点不就行了吗

mofans 发表于 2016-12-26 15:41:41

new var0没有赋值

spphins 发表于 2016-12-26 20:47:01

wuyukang 发表于 2016-12-26 14:29
提示目标无效,你因该把New Var0删掉。话说计算两点距离用得着这么麻烦?直接用一个GetDistanceTo节点就行 ...

删除后New Var0 不能用里面的函数啊。
我是想在关卡蓝图里 用其他蓝图的函数

spphins 发表于 2016-12-26 20:50:08

本帖最后由 spphins 于 2016-12-26 20:51 编辑

mofans 发表于 2016-12-26 15:41
new var0没有赋值怎么赋值,在level中创建一个distance蓝图的实例吗?

40412440 发表于 2016-12-26 21:21:47

distance蓝图把这个蓝图拖进场景中即可!
补充: 拖进场景中,选择这个蓝图.在关卡蓝图中右键.即可引用它

spphins 发表于 2016-12-27 17:45:14

本帖最后由 spphins 于 2016-12-27 18:13 编辑

40412440 发表于 2016-12-26 21:21
distance蓝图把这个蓝图拖进场景中即可!
补充: 拖进场景中,选择这个蓝图.在关卡蓝图中右键.即可引用它
...
拖入场景中在引用的方法我成功了。但是添加变量的方法还是没有成功(即使我把distance拖入到了level中)


更新:
我看了官方文档 Direct Blueprint Communication is the most common method of Blueprint Communication and is great for when you have two Blueprints that you know you want to have talk to each other at some point. This type of communication is always one-to-one; meaning one Blueprint (the "Working Blueprint") is requesting to access another Blueprint (the "Target Blueprint"). The simplest way to use Direct Blueprint Communication is to get a reference to the Target Blueprint through a publicly exposed object Variable and then specify which instance of that Blueprint you want to access.
红字说要要有一个实例。。。但这个不能赋值

https://docs.unrealengine.com/latest/CHN/Engine/Blueprints/BP_HowTo/DirectBlueprintComs/index.html

mofans 发表于 2016-12-28 09:49:23

spphins 发表于 2016-12-26 20:50
怎么赋值,在level中创建一个distance蓝图的实例吗?

1.在level蓝图中创建一个distance,然后赋值给newvar_0变量
2.拖distance到场景中,在level蓝图中引用它
页: [1]
查看完整版本: 蓝图引用的问题