I followed this tutorial to highlight interactable objects in my scene. However, I can’t get the blueprint interface to initiate the code on the receiving end. Using world-class debugging tools (print statements) I found that the code is being called but not executing. Somewhere between sending and receiving it’s failing.
Make sure both blueprints implement the interface under class settings, the blueprint that is sending and the BP receiving. Can’t see if the player has it implemented, the receiving BP does though. If that isn’t the problem I would make sure the line trace is hitting the object.
Having the player implement it made no difference. and I can confirm the line trace is hitting.
After the line trace, where are you setting Selected Actor to the OutHit Actor? I see you check if it implements the interface, but then you call the interface function IsSelected on an actor variable called Selected Actor. My assumption is that you need to call IsSelected on that returned OutHit Actor, shown below at time stamp: How To Select (Highlight) Other Actors/Objects By Looking At Them In Unreal Engine 5 - YouTube
if you follow the line back from the is selected node you’ll find that it goes back to the out hit actor node on the line trace if that’s what your saying. And the line trace works because if you look at the end it prints the name of the actor it’s trying to send and when I look at the actor in PIE the side of my screen is filled with the name.
Ah you’re right, my bad. But also, what is happening after the Branch of the returned boolean of IsSelected? There seems to be a false path happening with Selected Actor that is not visible in the screenshot:
Can you show what that is doing?
Look at the next picture, it should match
Maybe it has to do with the parent/child relationship of the actor you are trying to interact with. I know the parent implements those events but maybe you need to also implement them in the child, and make a call to the parent event?
Here is an example:
There are two functions, a message function and a non-message function:
Maybe you need to try calling the non-message function.
I get this when I try to use the non-message one
And in the tutorial, the message one is being used
I created a super simplified version of what you are trying to do, and everything works as expected:
First Person Character:
2023-01-05 10-31-20.mkv (4.9 MB)
So I honestly don’t know why yours isn’t working. If you simplify your logic to just call Select Actor immediately after the trace hit, does it work/print the string from your actor?
I copied your setup with the line trace and just the send, the line trace detects its an actor and it sends from the prints but there is no print saying it received
I just noticed that in the pictures above your setup has the interface under implemented interfaces, and mine under inherited. i don’t have a button to add implemented. is that the problem?
No this isn’t a problem because your child actor inherits the interface from the parent. I really don’t have an answer because I was able to recreate this (although simplified), without issue. I hope someone can help because I am out of ideas.
EDIT: The print string that is showing in your video, that is from the actor responding to the interface event, or are you printing the string after hitting the actor?
Thanks for trying anyway
After a day of troubleshooting I can’t believe i didn’t delete the BPI and remake it. It now works.
Glad you were able to fix it Sometimes Unreal can be cruel
Also if you see this, what is the name of the plugin that makes the blueprint lines neat?
Maybe you mean the electronic nodes plugin? Electronic Nodes in Code Plugins - UE Marketplace