Download

Class/Code structure regarding Interactive Objects

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?

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