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 switch my projectile thats fired based on a button..

So what I would like to do is switch the projectile that I'm firing (fireball or rocket etc) based on the button pressed in the user interface....so below I am spawning my projectile in my character blueprint and the other photo is showing my buttons to select the projectile...

alt text

Product Version: UE 4.22 Preview
asdfasdfzasdf.png (23.1 kB)
aasdfasdf.png (47.1 kB)
more ▼

asked Mar 24 '19 at 01:42 AM in Blueprint Scripting

avatar image

5 1 2 4

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

1 answer: sort voted first

You need to have the widget buttons communicate with your player controller/character (wherever you have the logic for weapon firing). A setup similar to this will work.

  1. Widget button "On Clicked" sets player controller variable "Weapon Selected"

  2. "Weapon Selected" variable is used as the input index for an array "Get" where the array holds the weapon types in a particular order

  3. Feed the selected weapon class from the array into a "Spawn Actor From Class" node

See screen shots below for rough example.

alt text alt text alt text

more ▼

answered Mar 24 '19 at 02:45 AM

avatar image

Nebula Games Inc
5.4k 28 9 15

(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