I’m a complete beginner when it comes to blueprints. I can’t code. I’m not a programmer. So forgive me if I mess up any terminology here.
I’m working on a tiny first person adventure game which only requires a simple interaction with a small variety of objects. I’ve set up a trigger box around the asset that displays a message in the viewport to press E to interact. I followed a couple of tutorials and hashed together a forward trace set up for when E is pressed another message appears. It’s placeholder for now while I figure the technology out. I created an interact interface and have implemented that into the blueprint. However, when E is pressed and the forward trace hits absolutely anything in the scene, the message pops up on the screen. I have no clue what I’ve done wrong. I’ve followed a couple of different tutorials independently with the same results.
Here’s some screengrabs of the Forward Trace and Interactable Object blueprint.
I posted it not so long ago, it demonstrates the kind of interaction that you’re after (and more!). And there’s a project link so you can get hands-on with it.
It’s hard to tell how you set things up; but generally speaking, you implement an interface on an actor, that interface gives that actor a bunch of functions. You call the interface and the actor executes its own version of that function. Simplifying but that’s the gist.
Yeah, I wanted to have something else happen to the object (visibility to toggle off) when the interact message comes in, but that didn’t seem to work, which is probably down to me not knowing what I’m doing, so I deleted it.
If I add something to the interact interface, will the whole sequence then work? I’m just trying to understand the logic. It was my understanding that: When E is pressed > initiate forward trace > if hits object with interface then display message > if not do nothing.
There’s a lot of helpful information there, so first of all I’d like to thank you for going above and beyond.
Unfortunately, it’s a little information overload for my noobie brain. I think I understand the theory, but it’s implementing it into my own project that I’m struggling with. It’s been the same with following tutorials. They’re often not exactly what I’m looking for, so trying to adjust things to what I need has been a painful process. I’ll give an example from your post in that thread. It’s using a 3rd person setup, so you’ve got a get hit result under cursor. I would assume that wouldn’t be feasible for a 1st person setup, which is why I’d use a line trace/forward trace, right?
So as it stands, the forward trace is hitting any object and triggering a ‘true’ response. When it hits an object with the interface it isn’t triggering the interface event. Is there any information I can provide which will make it easier for you to tell where it’s going wrong?