How to make an object interactable in Unreal?

Hi! So I’m new to using Unreal and I wanted to learn it, making a Nextbot Runner game style. I wanted to make a fully interactable vending machine that when interacted can spawn either a soda or an energy bar, but, I’m using a cinema 4d model, which I can’t edit in blueprint, any help is great!

Assuming you have exported the Cinema4D model as an FBX file and imported it into UE as a static mesh? I think the easiest way forward is like this:

  • Split the original model into the pieces you need, separating anything that should move. For example, the base model could be one piece, the vending buttons are separate, the food inside the machine separate, the door that opens to get the food separate, etc.
  • You can then combine these pieces into an Actor Blueprint and write Blueprint scripts to allow interaction and animation.

If this is your first foray into UE, I strongly urge you to spend some time doing the tutorials here: Epic Developer Community and be sure to use the Epic content examples, which will cover 90% of the things you want to do (at least early on in your new venture): https://www.unrealengine.com/marketplace/en-US/learn/content-examples

Good Luck!

2 Likes

I will export as an FBX file, however it doesn’t have any animation, as I was trying just to make a simple interactable object, and in the future do a more detailed object with animation. Does it need to have any animation?

If you don’t want to animate the object then it is a simple setup:

  • Create an actor blueprint for the vending machine

  • Add the static mesh actor (from the FBX) to the blueprint

  • Create an Interact Interface that you can trigger from the player and on the vending machine

  • When the interface is triggered, do whatever it is you want: e.g. give the player an item in their inventory

  • Add an input option to your player for interaction (e.g. E key)

  • When the player interacts, do a line trace and see if they are close enough to the object to interact with it

  • If they are, trigger the interface

Check out How To Interact | Blueprint Interface - Unreal Engine Tutorial - YouTube

1 Like