Hold E to Drink/Eat

So if you are not getting any events (something not printing ) then its somewhere around the
CreateScanner and EvaluateScanner scripts something can be missing.


Make sure you have a radius set properly 500 1000, profilename is correct

Make sure you are running timer with the correct function name UpdateScanner

Make sure UpdateScanner function running everytime with loop

you can check with breakpoint of from debug to see where your function is failing.

Hey there! I fixed it to an extent, so we are actually getting notified what our current interaction is now! I fixed that issue, it was some code I had messed up

image
Now my only issue is the number is still not changing on the Actor to be interacted on. :joy:

Perfect, thats a step forward. Now we have the correct interaction selected on our system and thats the most important part.

So when you call the components TryInteract and you hold button, it should fundamentally first run this SetInteractionState (Started)

and after should go in here

and call this timer.

Which calls again another event

and comes back to same function

Now we are on execution function running. You can make additional print on handle execution to see if everything is coming till this stage.
I can see from your log but be sure

image

So just over here a small explanation, why we run first SetInteractionState(Started) then loop outside come back in as SetInteractionState(Executed). Simple answer is cause we are trying to do it with BP unfortunately I cant create a delegate to a specific function with a variable in BP thats why we loop, we could have created another event but its ok.

On this stage I think if you did everything already this new print string should even fire

A subtle detail if you are not familiar with BP logic and interfaces there would be 2 functions in your interface, be sure that the function with the “message” is selected (the one with the envelope)

1 Like

Hey! So I set up a breakpoint and a print string on this line here

And I went to interact with out little test actor. And the breakpoint didnt process, nor did the print string. So I assume there is something wrong related to it? Any suggestions?

image

Select the correct class

Oh, wow. I cannot believe that’s what I had forgot to do this entire time :rofl::rofl::rofl:

Thank you so much!

I presume now I could move on with setting up animation/effects for the interaction?

No worries, think its good to go, till you encounter a design constraint in the system.

You can do animation, binding the events.

When an interaction is nearby you can show an interface, even pass details to umg follow actor in world if you prefer.

Its possible to do many things with it already a fair enough press E to Interact prototype.

In your game, in future if you encounter use cases like.

  • As a player I want to see counts of interacted item on ui.
  • As a player I want to see the name of the item I am interacting with.
  • As a player I want to see localized interaction names.
  • As a player I want to interact with the items that I am directly looking to.
  • As a player I want to shoot an interaction to interact.
  • As a player I want contextual animation before interaction.
  • As a player I want to interaction disabled with different gameplay contexts.
  • As a player I want to use an item, drink a potion to increase my interaction range.
  • As a player I want to interact with the things that is not around me but far away.

When you hit a use case that can not be achieved with the current architecture, it can be time to iterate overall system. Till then its good to go.

Happy developing!

Thank you friend! :heart:

1 Like

Thank you too! Would be great if you can mark post 8 as answer so it can become more accessible to community readers with search.

1 Like