How do I add the "E" prompt to a movable object after I aim my crosshair in it?

2025-08-27 22-40-40.mkv (11.7 MB)

Event pre construct →Branch(isDesignTimer)→False →SetVisibility(Collapsed)

like in my scripts lets start with that first. That should clear that errors.

2025-08-27 23-41-17.mkv (13.0 MB)

your correction reduced the errors a bit, and it was still showing some error for the print string node so I just disabled it and it reduced some more errors.

Try to start your character a little away from the interaction. Seems its working already but since you start already overlapping it is causing bug.

Simply you can delay until next tick in your scanner on begin play here somewhere or uncheck update overlaps if issue persists.

Moved the TestInteractionActor_BP far from me and did some slight fixes and the error is now redirecting me to this node:

It is like the only thing that I did differently from you cause I can’t find the set text node you were using.

Can you show how you added that set node?

And you told me to make sure that CurrentInteraction is not null, I don’t know exactly which value I need to change for it to be not null.

And how do I delay until next tick in my scanner on begin play? or uncheck update overlap? Can you demonstrate it

Just make update overlaps like below so if player starts already overlapping has less problems

For text setting drag a pin from the text block variable (InteractionLabel for example) and write text.. under content its set text.

Nodes are context sensitive so some nodes if you cannot find, try dragging a pin from the node and try to search like that. It is a common practice.

image

do these 2 and update forum thread if you have more problems around it. Its ok.

2025-08-28 04-52-56.mkv (12.9 MB)

this time

the widget is showing in the edit mode ✓

I managed to use the pink set node that you were using ✓

but this time the engine crashed when I tried to reach the TestInteractActor_BP ×

did I mess up the variable types? I mean in the InteractionComponent, it is in string type but in InteractionPrompt_WBP I set their type to Editable Text Object Reference

its just a regular text block of umg

bro finally it worked! just had to change the ‘variable’ and ‘set node’ type to “text object reference” instead of “text editable object reference."

I was using the set node that required variable of type “text editable object reference” the whole time.

1 Like

Great :rocket: keep doing, practice makes it perfect!

1 Like

well hello again, so I was trying to apply the Interaction Component to actor with door mesh, and I realized it only triggers when I look at the bottom left:

I managed to make the prompt be shown in the middle instead, by replacing the ‘get actor location’ Screenshot 2025-08-31 222002 with ‘get actor bounds’

:

and it showed the prompt in the center of that object. But the prompt still triggers only when I look at the origin of that object where It used to be. Even if the object is not there anymore:

So I want it to trigger when I look at it on it’s current location not at the origin location

And I want it to trigger when I look at any part of the object, meaning even if I look at the handle of the door I still want it to trigger.

Allright great progress.

So I would like to carry you one step forward rather than actually solving /shortcutting the problem.

So when you are interacting with an object in the world with this design.

  • Normally we were getting actor origin location which is kinda right. A simple way to introduce you to the design problem and solution space.
  • Now you are having a problem over positioning and can be coming from geometry, actor origin etc. Since first scripts was considering actor origin location it is failing since the even prompt position calculated right the priorization still runs on the actor location like below

What is next?

  • We can approach the problem in many ways like getting the static mesh or static mesh origin or as you do getting the actor bounds.
  • However this won’t be even enough since you will want to appear the interaction prompt on a specific place sometimes. Ex: On the door’s door knob.

In order to this what can we do? What’s next?

  • After detecting the actor that have interaction component you can ask if this actor has a specific component.. Something like a “SceneComponent”
  • If this component exist, you can get it’s location in scanner also in ui, so where ever you place this scene component in your actor, the position of prompt will be exactly appear there. If not (false) then you can continue with actor bounds.
  • Optional : Whenever you add an InteractionComponent this scene component can be automatically added to it’s owner like we did in InteractionScannerComponent even you can name it. If you do like this so you can always rely on it.

In simple terms just to recap

  • Create a script on InteractionComponent that adds a SceneComponent to owner on construction. OR manually add.
    A sneak peak below

I will let you do the rest since that is how you go forward but don’t hesitate to ask if you really really get stuck.

1 Like

You can also create a C++ subclass of SceneComponent with a special name if you prefer. Something like InteractionPromptPosition.

This won’t be mixed with other scene components on the actor if exist more than one (which is quite common)

1 Like

well I couldn’t figure out the C++ scripting quite that much and I did not work well with manually adding the [Scene Component], so I just tweaked the ;Rule Check Angle; function from ‘InteractionScannerComponent’ a bit and it just works.

Now how do I increase the effective interaction bounds of the object?

Yeah it should work, however keep in mind it won’t be the exact spot at all times which can be fine in your case.

For distances you can have couple of approaches but what I would recommend is having them on the InteractionComponent side would be better.

1- Define a Blueprint Enum with variable names as Short, Medium, Long.

2- Define a new variable inside the InteractionComponent near InteractionLabel and Action name as InteractionDistance as type the enum you created and expose the variable public so you can see in details panel.

3-InteractionScannerComponent define 3 variables as ShortInteractionRange, MediumInteractionRange and LongInteractionRange as float. Write their defaults as you wish, something like 200 500 900.

4- Remember when we were creating the scanner sphere we defined a radius for it, you can simply set radius as LongInteractionRange so it covers everything that can be interacted in range so you can simply plug LongInteractionRange to InSphereRadius.

5- Defining The New Rule : So right now we have only one rule function which is RuleCheckAngle , let’s make a new function before that as :RuleCheckDistance and input the component.
Inside this function get component and Distance(ScanneSpehere->WorldLocation, InteractionComponent->owner->whatevercomponent->origin)… So now we have a distance between the scanner and the interaction point. ..

Also we need to access the variable we defined right? So inside function again InteractionComponent->InteractionDistance

Make A select draggin pin from it , assign your ranges into select and check against the current distance (less or equal) and return bool out of function.
Something like this ofcourse you can change to whatever component you have in your target

6- Order of Rules : It is better to check distance first, we can optimise it better actually but for the sake of the understandability let’s go like below. If 2 rules turn True the interaction will be selected, if the distance not matching or distance matching but not angle it won’t simply not showing interaction.

results
Left Long, Mid Medium, Right Short Range interactions

1 Like

If you want to change bound (angle of interaction accuracy) you can use same pattern.

  • Define enum of angles, small, normal, big and assign enum to component.
  • Get component variable in scanner and assign to MaxDegree in function and compare.

Or you can get more sophisticated in future like auto detect mesh bounds, trace etc. however this is more designer friendly since they can have some control over it without breaking the ux gameplay pattern.

1 Like