# 关于按钮开关灯和开关门

**URL:** <https://forums.unrealengine.com/t/topic/2143759>\
**Category:** 简体中文 (Simplified Chinese)\
**Tags:** unreal-engine, question\
**Created:** [November 22, 2024, 4:30pm UTC](https://forums.unrealengine.com/t/topic/2143759 "2024-11-22T16:30:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hou\_hua](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hou\_hua](https://forums.unrealengine.com/u/hou_hua)\
**Post date:** [November 22, 2024, 4:30pm UTC](https://forums.unrealengine.com/t/topic/2143759/1 "2024-11-22T16:30:31Z")

</div>

我希望有一个按钮,可以开关灯或者开关门  
当我按下按钮A时可以开一盏灯,按下按钮B时可以开一扇门(AB都是同一个按钮蓝图)  
我用了一个统一的 互动 接口和射线检测,每个东西都有自己的互动事件.灯的互动事件是亮灭,门是开关,按钮就是传递互动事件  
我的思路是与按钮A互动时,按钮A会去触发灯的互动事件.与B互动时,按钮B会去触发门的互动事件.但是我现在卡在了怎么让按钮触发灯或门的互动事件这一步.如果把这一步写在关卡中耦合度感觉又太高了.也许我应该把按钮放在灯和门的蓝图里面?  
是我的思路有问题吗,希望各位前辈能够指点一下

---

<div class="post-metadata">

**Author:** ![tootzoe1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@tootzoe1](https://forums.unrealengine.com/u/tootzoe1)\
**Post date:** [November 22, 2024, 5:48pm UTC](https://forums.unrealengine.com/t/topic/2143759/2 "2024-11-22T17:48:49Z")

</div>

这种功能通常用接口来实现
