Download

[HELP]Find actor and call function

Hi friends, i am newbie of unreal engine. i want find object for call function in object.

Example of Unity c# ;

GameObject.Find(“Object”).GetComponent<MyBlueprint>().callfunction();

Thx for help , sorry for my english

Welcome

I am assuming you want blueprint equivalent of this.

This is documentation:

And blueprint communication:https://youtube.com/watch?v=s5pIrpI7py8https://www.youtube.com/watch?v=xu1a9jFZc7g

Read/Watch above stuff.
For your code closest thing would be:

  • create MyBlueprint blueprint
  • make function inside it.
  • place that blueprint into level, so best if blueprint had some visible component.
  • in blueprint you want to communicate from (best here is player controller as it has all inupt by default) create keyboard event,
  • in that keyboard event, add graph “get all actors of class” and point it to your blueprint class, it should find your blueprint in level
  • add “get” node (drag result pin from “get all actors” out and type get), so you get all actors, then get array element 0.
  • now you have reference to your blueprint in level (reference is fancy name for pointers in blueprints, there are different flavors, but for that watch tutorials)
  • from reference to your blueprint add “Cast to” and tell it its blueprint class
  • now you have reference that points of first instance of blueprint found in level, drag result and you can type name of your function, it should give you “Call function” node

Quite complicated without picture, so if nobody post that pic here you are better with watching tuts.

Here is a solution

6c503d5ce73a8c08e37b1f524c691dbcba5bb9ed.png

Documents and videos not for me but ur comment for me thx Nawrot.

i want this for my dedicated server. i install this system [FREE] VaRest Login System - With PHP and MySQL - Community Content, Tools and Tutorials - Unreal Engine Forums in my vds server. Clients find server actor for call login , register and other function. Do you think it works?

Mhousse1247 , thx bro :slight_smile: