Enable collision on Scene Component?

I´m making a interaction system, so when you look at the scene component “Intractable” I need it to send a event to the character etc. Basically my goal is:

When you look at a door knob, a npc, or anything intractable it popups a text saying the name of the interaction. And when you press space it interacts, very easy to do in all other engines, but I can´t understand how to do it in UE4. Thanks in advance :slight_smile:

Hi

You will need to do a line trace with a blueprint interface. I would setup a distance limit so it does not pick things up too far away.

I use this when coming up to shops, so when the player is close enough and taps the screen, it finds which BP I have tapped on and runs scripting within that blueprint. i.e. opens a widget.

You could run this off event tick, so where ever the player is looking, it could check example 500 ahead and when hits a intractable , a widget opens and you can run interaction of that.

Blueprint interfaces explained here:

Regards

Thank you, I’m an experienced programmer so I know all about interfaces, I just don’t know how to put like a collision box on a scene component. I’ve worked with other engines and it has worked there very easily

@MomoLegitMan… welcome! :slight_smile:

A line trace is an option… you could also add a collision component and use ‘hit’ or ‘overlap’ to generate the event. I think I’ve seen youtube tutorials on this topic implementing interfaces too

Hi

I can not post pictures at moment, not sure why.

But, in Treasure Chest for example.

  1. Make the Blueprint
  2. Around chest, add a box collision - under Collision on the dropdown menu on left side.
  3. Name it
  4. Now in the menu on the right side, down the bottom you will see in green, Add event for Begin overlap. Press the +
  5. Go to event graph and you will see a node - ‘On Begin Overlap’
  6. Out from ‘Other Actor’ drag out and search for your character, example ‘Thirdpersoncharacter’.
  7. This will create a node ‘Cast to thirdpersoncharacter’
  8. The event node will only fire when the character overlap the collision box.
  9. ‘Cast Failed’ will execute if anything else overlaps that is not the player character.

It seems a lot more work then it is, but it is very simple.

EDIT: Hope these pictures work.

Regards

Thank you, I know how to do collision and line traces and interfaces and all of that, my question is still how to add a collision sphere to a SCENE COMPONENT, that is very important. Would a line trace work for SCENE COMPONENTS ? It´s important that my system is dynamic, not a brute force solution

Okay, in unity and Arma this was very easy. I just made a added a trigger box to it and have it a script. I don’t want to hand code each . Maybe I could have the scene component attach a collide on start. Thanks

@MomoLegitMan… as far as I know scene component and a collision component are simply different things.

As you know, you can have a collision component and scene component in the same location on your actor. But… as far as I know a scene component in itself will neither collide with other objects nor block a trace (though I haven’t tested it… and your proposition worth testing though).

well, you can start with a generic actor… and add whatever components are useful… mesh, collision box/sphere/etc, scene, etc

“A scene component has a transform and supports attachment, but has no rendering or collision capabilities” UE4 tooltip

honestly, I’m puzzled why you absolutely need some kind of combined scene/collision component at all… scene component is just a blank dummy helper…

When you add a sphere collision, it is automatically apart of/attached to the scene component.

I need the same, want to add a box collision inside of a scene component which is just a simple scene component class. so Did you solved it?