[Solved] Modify Text object from within a function

I am becoming a big fan of Extension/Functions since they let me parameterize a block of common code and use it for handling multiple objects. The one thing I have not been able to figure out is how to update the text of a scene’s text object from within the function.

I have a text object named “nameSelected” and if I add the following code from the scene’s event/action screen, it works fine:
Do = “U” to the text of nameSelected

If I create an action within a function, I get an error saying “the object does not exist or can’t be used here”.

I tried creating the “Modify the text of a Text object.” action using the actions list and also tried copying the action from the scene action to the function - same results.

Should this work? If not, why is the “Modify the text of a Text object” action available when in a function?

AARG - never mind - after fighting this for a couple of hours, I realized that I needed to pass the text object into the function so the function could “see it”

Moderator - you can delete this question if you want.

We can keep this topic for future users who will need help :slight_smile:
I close it