How can I make a widget generate custom text based on the ObjectName of an interactable object? Using the First Person Story Adventure Template.

Hi there,

First time questioning, long time listener. I am using the First Person Story Adventure template as the base for my game. The established system for looking at interactable objects is ideal for my setup. I want to build off of it by using a widget that generates custom text whenever the player encounters an interactable object.

ie: Open Door, Talk, Read Letter, etc

The main systems of interaction are dependent on the Player Controller (Actor Blueprint) and the Master Interactable Object (Actor Blueprint) Child blueprints are derived from this “Master” blueprint so that they carry the “Interactable” tag.

I am able to make a widget appear when the player is pointing at an interactable object. My problem is controlling the custom text in the widget; getting it to communicate with the interactable object (ObjName). Below is an example of something that I tried and failed.

I attempted to create a binding for the text block but I cant create a successful function to generate the ObjName.

Can you do a bigger pic of the interaction trace, can’t read it… :slight_smile:

yes thank you for your reply. Here it is in 2 parts:

Ok, so you’re making the widget at the end of the chain.

Why not make a string ( name etc ) type variable in the widget and set it from here?

You can get the name of the object from A and get a hold of the variable to set it at B:

Ok so generally hit actor has all the info you need. If you need a specific variable from the interactable object, cast to it and get a variable from there. If it’s a display name there’s a node for that so you can take a display name from hit actor.
Then you want to make a variable in your widget Exposed on Spawn and Instance Editable

347493-3.png

After that you after you make a node “create widget” there will be another pin, hook a variable from your interactable object to that.

This question was solved in a reddit post: https://www.reddit.com/r/unrealengine/comments/pfi084/how_do_you_generate_custom_text_on_trace/