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 to fire a event when a button is clicked ?

What im trying to accomplish is having my weapon switch by clicking/touching the button, i manage to accomplish it through keys but when trying a Event Dispatcher and Binding it wont work... im probably doing it wrong can somebody help me out. Thanks

Product Version: UE 4.10
Tags:
more ▼

asked May 14 '16 at 07:18 PM in Blueprint Scripting

avatar image

Juanjose09
111 9 14 22

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Don't excactly get you, but have you tried to do it from edit > project settings > input > new action input?

  • Erik

more ▼

answered May 14 '16 at 09:42 PM

avatar image

erik321123
408 17 15 31

avatar image Juanjose09 May 14 '16 at 11:54 PM

Hello erik thanks for the quick response, sorry if i not clear is not a actual control button is a inventory button i got in my widget game hud which i would like to use to switch the weapon instead of pressing number key, as you yo can see in the screenshot my weapon configuration is set to switch when pressing number 1 and 2 but i want to change that to my inventory button so when click or touch (since it will be a mobile game) switch the weapon.alt text

alt text

avatar image jtsmith May 15 '16 at 12:01 AM

Are you getting an error when you click the widget button?

avatar image Juanjose09 May 15 '16 at 12:09 AM

No, everything compiles without a problem but doesn't work

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

If you are only trying to fire an event between 2 blueprints only, event dispatcher may not be your best solution because it's a competitively expensive operation. In that case an interface or even a direct communication with the blueprint may be best. Event dispatcher really shines best when you have multiple blueprints listening for the call.

However, for event dispatcher you need a reference to the blueprint that 'owns' the dispatcher. For example, if the ED is on your player controller and you are binding it on your weapon BP then on your weapon BP you need to get a reference to your custom player controller and plug it into the binds Target pin. Make sure the function/event that you bind to the ED call has the same signature as the ED call or it won't bind.

This is the best answer I can give with the information provided. If this doesn't help them please elaborate and possibly include screenshots.

If this did help please consider accepting the answer by clicking the check mark next to my answer. You'll know it's right when the answer turns green. Note: adding a comment after accepting an answer deselects it as accepted and will need to be accepted again. Thanks!

more ▼

answered May 14 '16 at 10:56 PM

avatar image

jtsmith
1.4k 70 29 92

avatar image Juanjose09 May 15 '16 at 12:05 AM

Hello Smith, thanks for the respond i will try to do what you subject but im still a little bit confuse is not a actual control button is a inventory button i got in the widget hud instead of actual pressing a numbers key to switch weapon, use the inventory button when clicked or touch (Touchscreen mobile game ) to switch the weapon, i uploaded screenshot above thank again.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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