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"

Weapon Selection System

At the moment I have a fleshed out weapon system that includes various things like ironsights, muzzle flash, reloading, ect, but it is all handled inside the player blueprint and not in a weapon specific blueprint. I feel this will fill my player blueprint space pretty quick and just seems like an inefficient method. Im interested in expanding each weapon into its own specific blueprint, but Im not sure how I should have everything work together. Ive basically expanded a lot on the FPS blueprint template.

alt text

Product Version: Not Selected
more ▼

asked Dec 20 '14 at 08:03 PM in Blueprint Scripting

avatar image

245 41 52 65

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

1 answer: sort voted first

I have been slowly experimenting with various ways of doing this, initially I did it all in the player blueprint too, but I found that having specific weapon blueprints is definitely the way to go. The hard part for me was actually calling those blueprints to function inside the player blueprint when called, but it is very easy! The way I achieved it is by creating the weapon BP, which contains the shooting logic, ammo count, gun mesh, etc, and then exposed all variables that I would want to change for future weapons (so I could easily duplicate and switch out meshes). I had the "fire" logic made as a function, and then in the Character blueprint, I got all actors of the Gun BP class, cast to that specific BP, and then from there I could expose the functions as variables and I could call the shooting function when the player presses shoot. To attach the mesh to the player, I just spawned the WeaponBP actor at event begin play, at a socket on the character mesh. This definitely isn't the best way to go about it, but it could help you get a step further. My next goal is to have a simple 2 weapon inventory system, so instead of calling specific functions and weapons on spawn, I would be able to call a variable that then sets those values!

more ▼

answered Dec 29 '14 at 02:24 PM

avatar image

111 31 25 31

(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