查看: 901|回复: 15

[可视化蓝图脚本] 【Direct Blueprint Communication | Unreal Engine】

[复制链接]

1

主题

342

帖子

7万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
75866
发表于 2016-6-27 15:58:45 | 显示全部楼层 |阅读模式



This page covers using Direct Blueprint Communication to communicate between two Blueprints and pass information between them.

For this example we will allow the player to pass through a box and communicate with and activate a particle effect.

For this guide we are using the Blueprint Third Person template with Starter Content enabled.

In the Content Browser, open the Content/StarterContent/Shapes folder.

Right-click on the Shape_Cube, then under Asset Actions, choose Create Blueprint Using This...

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



Click Ok at the confirmation box that appears to create the Blueprint.

Inside the Shape_Cube Blueprint, select the Static Mesh in the Components window in the upper-left.

In the Details panel, change the Collision Presets to OverlapOnlyPawn.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



This will ensure that only the Pawns and by extension Characters can pass through the box.

In the MyBlueprint window, click the Add Variable button and name the variable TargetBlueprint.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



This will be the other Blueprint that we want to directly communicate with.

In the Details panel for the variable, set Variable Type to Blueprint_Effect_Fire and make it Editable.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



Here we set the Blueprint that we want to communicate with and made the variable publicly editable (editable outside this Blueprint).

Select the Static Mesh in the My Blueprint window, then in the Details panel, add an On Component Begin Overlap Event.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



This will add a node and open the Event Graph where we can provide the script that occurs when entering the cube.

Drag off the Target Blueprint and Get P Fire and Get Fire Audio, then connect as shown to an Activate node.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



Here we are accessing the Particle Effect and Audio components inside our Target Blueprint and Activating them.

In the Content Browser under Blueprints, drag the Shape_Cube Blueprint into the level.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



In the Content Browser under Content/StarterContent/Blueprints, open the Blueprint_Effect_Fire Blueprint.

In the Components window, select P_Fire then in the Details panel un-check Auto Activate.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



We do not want this effect to auto activate as we will tell it to activate when entering the box in our level.

Drag the Blueprint_Effect_Fire Blueprint into the level.

Select the Shape_Cube Blueprint then in the Details panel, use the drop-down to select the Blueprint_Effect_Fire Blueprint.

【虚幻4翻译文档-Direct Blueprint Communication | Unreal Engine】[虚幻4中文文档]



Here we are specifying the instance of the Blueprint_Effect_Fire Blueprint in the level that we want to communicate with. If we have placed several instances of the Blueprint_Effect_Fire Blueprint in the level, each of the instances would be displayed inside the drop-down menu allowing us to indicate which instance is the Target Blueprint to communicate with.

Clicking the Eye Dropper icon allows you to select the instance of your Target Bluperint inside the level instead of using the drop-down menu. Remember, you can only select Blueprints to target based on the variable type you have specified.

Click the Play button to play in the editor and test running through the box with the character.

You will see that once the character enters the box, the fire effect will be activated inside the level. You can use Direct Blueprint Communication to not only change the properties of a Blueprint from inside another Blueprint, but you can also pass the values of Variables, call Functions or Events, or anything else that the Blueprint would otherwise normally be able to do.



   



   



      




   


      相关页面

  




       管理蓝图通信








      蓝图交互的用法








      蓝图用户指南




回复

使用道具 举报

0

主题

820

帖子

2660

积分

vip会员

Rank: 1

积分
2660
发表于 2016-7-2 19:57:22 来自手机 | 显示全部楼层
楼主能发图瞧瞧嘛
回复 支持 反对

使用道具 举报

0

主题

815

帖子

2680

积分

vip会员

Rank: 1

积分
2680
发表于 2016-7-4 02:37:13 | 显示全部楼层
最喜欢全套的了
回复 支持 反对

使用道具 举报

0

主题

831

帖子

2752

积分

vip会员

Rank: 1

积分
2752
发表于 2016-7-4 12:08:42 来自手机 | 显示全部楼层
多少钱,看看
回复 支持 反对

使用道具 举报

0

主题

860

帖子

2771

积分

vip会员

Rank: 1

积分
2771
发表于 2016-7-4 12:08:43 来自手机 | 显示全部楼层
这个必须顶,,,,
回复 支持 反对

使用道具 举报

0

主题

853

帖子

2778

积分

vip会员

Rank: 1

积分
2778
发表于 2016-7-6 20:26:11 来自手机 | 显示全部楼层
好东西都要支持, 谢谢了
回复 支持 反对

使用道具 举报

0

主题

919

帖子

3032

积分

vip会员

Rank: 1

积分
3032
发表于 2016-7-8 00:42:44 来自手机 | 显示全部楼层
看看这个好不好啊
回复 支持 反对

使用道具 举报

0

主题

898

帖子

2949

积分

vip会员

Rank: 1

积分
2949
发表于 2016-7-10 11:18:09 来自手机 | 显示全部楼层
这个必须可以有
回复 支持 反对

使用道具 举报

0

主题

824

帖子

2714

积分

vip会员

Rank: 1

积分
2714
发表于 2016-7-10 12:01:30 来自手机 | 显示全部楼层
好东西,所噶
回复 支持 反对

使用道具 举报

0

主题

868

帖子

2865

积分

vip会员

Rank: 1

积分
2865
发表于 2016-7-12 02:58:28 来自手机 | 显示全部楼层
这个屌,看看要多少金
回复 支持 反对

使用道具 举报

*滑块验证:
您需要登录后才可以回帖 登录 | enginedx注册

本版积分规则

 
 



邮件留言:


 
返回顶部