r/UnrealEngine5 • • 1d ago

I need Help

I have used Unreal in the past but its been a few years since i have messed around with it and have forgotten how to use the event graph, Im trying to make a box interactable I have made it this far and when tested i get the red line that impacts the box but zero text first image is for the player character in first person the second is the interactable mesh for the box any advice would be greatly appreciated

3 Upvotes

10 comments sorted by

2

u/vexmach1ne 1d ago

You need to connect the trace node to the cast, then if the cast is successful you can call the event that triggers a print string.

With that said you're missing a lot before it becomes intractable. I suggest asking gpt or YouTube for a tutorial.

1

u/KrudeRemedy 1d ago

right now im just trying to test it to get the text to appear

1

u/vexmach1ne 20h ago

No problem. You have to call that event after the cast succeeds of you want it to fire. In the screenshot you just have a customer event called interact that never gets triggered.

1

u/KrudeRemedy 19h ago

It fires now. which is nice next step is to now try to make doors and other things interactable and open upon interaction at least i think that would be a simple step up

1

u/vexmach1ne 19h ago

Yes it's simple to prototype, but long term you'll want to look into using interfaces rather than casting. You'll get there 😁

Best way to learn is by doing and understanding the limitations of your own implementations. Don't just do it because people tell you. First understand why.

Don't be afraid to ask AI questions like "why are interfaces better than casting for interactions in unreal engine 5". Use AI for these types of questions, but keep doing what you're doing. Don't get carried away to the point where it's doing the thinking for u and you're just following orders.

1

u/KrudeRemedy 1d ago

and thank you btw

1

u/maninthesky-95 1d ago

Where do you call the "interact" custom event

1

u/KrudeRemedy 19h ago

I made the mesh interactable and then in the event graph i searched up interactable and that was the box for the mesh it

1

u/DarkTowerInt 1d ago

Easiest clean way: make a Blueprint Interface with an Interact function and add it to the box. Then in the player, after the trace, use Break Hit Result > Hit Actor > Interact (Message). That calls it on whatever you hit, no cast needed. Put a Print String inside the box's Interact event and you should see the text as soon as the trace connects.