Announcement

Collapse
No announcement yet.

[HELP]Find actor and call function

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [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

    #2
    Welcome

    I am assuming you want blueprint equivalent of this.

    This is documentation:
    https://docs.unrealengine.com/latest...mms/index.html

    And blueprint communication:
    https://www.youtube.com/watch?v=s5pIrpI7py8
    https://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.

    Comment


      #3
      Here is a solution

      Click image for larger version

Name:	test105.PNG
Views:	1
Size:	118.3 KB
ID:	1098012
      Website [ LINK ]
      Twitter [ LINK ]
      Support ! [ LINK ]

      Comment


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

        i want this for my dedicated server. i install this system https://forums.unrealengine.com/show...ghlight=varest in my vds server. Clients find server actor for call login , register and other function. Do you think it works?

        Comment


          #5
          Mhousse1247 , thx bro

          Comment

          Working...
          X