# Class/Code structure regarding Interactive Objects

**URL:** <https://forums.unrealengine.com/t/class-code-structure-regarding-interactive-objects/72269>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 27, 2016, 9:45pm UTC](https://forums.unrealengine.com/t/class-code-structure-regarding-interactive-objects/72269 "2016-08-27T21:45:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raildex](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Raildex](https://forums.unrealengine.com/u/Raildex)\
**Post date:** [August 27, 2016, 9:45pm UTC](https://forums.unrealengine.com/t/class-code-structure-regarding-interactive-objects/72269/1 "2016-08-27T21:45:34Z")

</div>

Hey there,  
I’m currently working on a third person Adventure, where the player has to use buttons, levers, keys, open doors move objects around etc. to progress.

I’m not sure about the class/code structure though. What I need is:

Ensure the Character positions itself properly.  
If the character is aligned, play Animation to the interactive Object (Pull lever, press button,open door etc.)  
Activate XYZ when Lever / Button / Key is used.  
How should I handle if the player needs to move objects around? A custom Movement Mode for this?

Does someone have a basic idea or suggestions how to start this?

---

<div class="post-metadata">

**Author:** ![Max\_TV\_35](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Max\_TV\_35](https://forums.unrealengine.com/u/Max_TV_35)\
**Post date:** [August 28, 2016, 1:45pm UTC](https://forums.unrealengine.com/t/class-code-structure-regarding-interactive-objects/72269/2 "2016-08-28T13:45:53Z")

</div>

I found this video quite helpful… somewhere in the middle he goes through how to trace a sphere shape on front of the character to see if it hits anything (like your switch or lever) and if so, that gives you a reference you can use to trigger events / run blueprint functions which do stuff. You can use this as the basis for opening doors (as shown in the video) or whatever…  
[https://docs.unrealengine.com/latest/INT/Videos/PLZlv\_N0\_O1gYuWkyTSbfcuyPNOQsK\_8bu/EM\_HYqQdToE/index.html](https://docs.unrealengine.com/latest/INT/Videos/PLZlv_N0_O1gYuWkyTSbfcuyPNOQsK_8bu/EM_HYqQdToE/index.html)
