# Affecting an object via another actor.

**URL:** <https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871>\
**Category:** Editor Scripting\
**Tags:** reference, unreal-engine, Lighting, Blueprint, question\
**Created:** [July 22, 2016, 11:21pm UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871 "2016-07-22T23:21:34Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_979e8ae3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_979e8ae3](https://forums.unrealengine.com/u/anonymous_user_979e8ae3)\
**Post date:** [July 22, 2016, 11:21pm UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/1 "2016-07-22T23:21:34Z")

</div>

I’m looking for a way to affect object (X) when I interact with object (Y).  
For example, I want to turn off/on a light source in my scene via interacting with another object, the light switch.

I have the interaction event setup to trigger nodes within the actor blueprint but don’t know how to reference an object in my scene which is separate from the actor.

The only way I’ve found to get this working is if my switch and light source are in the same actor blueprint. Ideally I want my switch / event trigger to be separate from what i’m trying to trigger.

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [July 23, 2016, 1:11am UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/2 "2016-07-23T01:11:44Z")

</div>

You might want to use an [event dispatcher](https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/EventDispatcher/) OR expose a variable that you can set in the editor that allows you to set the actor you need. If you are using overlap or hit events, then you can extract the other actor from that.

Can you give more details? Then I can give a better answer.

---

<div class="post-metadata">

**Author:** ![expose](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@expose](https://forums.unrealengine.com/u/expose)\
**Post date:** [July 23, 2016, 9:45am UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/3 "2016-07-23T09:45:13Z")

</div>

you can find what you need in the content exemple project (level scripting project)…  
and as noobs said, you ll need to bind an event .  
more info here :

> **[How do I use delegates in blueprints?](https://forums.unrealengine.com/questions/151561/how-do-i-use-delegates-in-blueprints.html)**
>
> I can access interfaces in (for example) a spawned AI from the level blueprint by keeping a variable that stores the AI, and using that to access the interface. However, I really want the AI to be able to call functions in the level blueprint. How...

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_979e8ae3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_979e8ae3](https://forums.unrealengine.com/u/anonymous_user_979e8ae3)\
**Post date:** [July 23, 2016, 11:02am UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/4 "2016-07-23T11:02:52Z")

</div>

![99696-light+switch.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/f/a/3fa4921fbf3d185f0f5a77be22c9bbdda17939f0.png)

Essentially i have a switch (Green cube) and i want to turn off the pink light. I’ve already got it set up that i can affect anything within the green cube actor, but i want to be able to control other things in my scene via this / similar switches.

---

<div class="post-metadata">

**Author:** ![NoobsDeSroobs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NoobsDeSroobs](https://forums.unrealengine.com/u/NoobsDeSroobs)\
**Post date:** [July 23, 2016, 11:10am UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/5 "2016-07-23T11:10:45Z")

</div>

If the green cube is a generic switch that can take any light or actor I would say that you should make a variable inside the switch called ‘Light’ and expose it (click the closed eye to open it). Then, in the editor you can select the switch and in the details windows you can set an actor as the Light. Then, as the switch is activated it calls whatever function you want to call on that exact light.

If you have another switch that should affect another light or you want to change what light is being affected, then simply change the variable in the details panel.

EDIT:  
Btw, if you want to take a screenshot of a small part or the entire window or your entire screen, think about using a tool like puush. You dont have to save a copy on your computer and it automagically uploads the image and gives you a URL.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_979e8ae3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_979e8ae3](https://forums.unrealengine.com/u/anonymous_user_979e8ae3)\
**Post date:** [July 23, 2016, 11:30am UTC](https://forums.unrealengine.com/t/affecting-an-object-via-another-actor/364871/6 "2016-07-23T11:30:56Z")

</div>

Worked brilliantly, thankyou!  
ty for the tips aswell.
