x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How Do I Call an Event from a Character Blueprint by Clicking a Button on my HUD Widget Blueprint?

First, I am new to all this. Sorry if this has been answered already, but I haven't been able to find an answer.

I am wanting to move my character between multiple target points by using a custom event and then referencing/calling in the event by pressing a button on the HUD.

  • The event works just fine by itself when I plug it into event begin play. I only run into problems when I try to reference it with the button.

  • I've tried casting to the character as well as calling the event. I don't know which works. Pictures Included.

For the life of me I cannot get this to compile. Is what I am trying to do even possible? Thanks in advance for the help.

alt textalt text

Product Version: UE 4.20
Tags:
more ▼

asked Oct 16 '18 at 07:32 PM in Blueprint Scripting

avatar image

Larsen09
1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Your cast to AI character is not casting to anything, it needs an object input. (What object would you like to cast to).

Casting is like asking an object if it is a certain object or not. If it is, it will succeed, then you can drag off the output of the cast node as that object and call functions that exist on that object.

So your going to need a reference to the object you want to cast to, depending on how you have things setup this can be done in a lot of ways.

Inside your widget, there is a function called "Get Owning Player Pawn" this will give you a reference you can cast to. Then try casting it to your custom AI character to has the function you want to call, then try calling that function.

You also need to make sure that when you create the widget that you provide it with an owning player. (In this case you could use a reference to "self")

This is fundamental blueprint communication and it is going to be something you have to learn to do almost anything with the engine. I highly recommend this epic tutorial with Zak Parrish on all forms of blueprint communication. It hands down has to be the very best tutorial on this that exists.

This will really help you: https://www.youtube.com/watch?v=EM_HYqQdToE&t=1s

more ▼

answered Oct 17 '18 at 09:55 AM

avatar image

Steve SybrSyn
1.4k 4 5 9

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question