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 have diffrent weapon characteristics


So i have my Assault rifle and my Shotgun, both are child actors under a "weapon class". I can pick them up, but i have no way of changing the characteristics so all i have is an assault rifle that has as much ammo, range and damage as a shotgun, how do i change this.

Product Version: UE 4.15
more ▼

asked Jun 04 '17 at 03:02 PM in Blueprint Scripting

avatar image

3 2 3 7

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

3 answers: sort voted first

In general you should have Fire function in base class (weapon class) and weapon should have invidual code for it, probably Fire won't be only base function you will need to do to make full blown weapon system, but that depends on weapon system you do, all common features of weapons should be based in base class. Also ammo should be managed by base class also. Alternativly you can make entire weapon system in only base class with diffrent setting varbales defining weapon behavior which you just set in child classes without any code, and base class code do as settings of weapon tell, but if you want weapons to have more freedom you should pick first option.

more ▼

answered Jun 04 '17 at 04:44 PM

avatar image

36.6k 932 169 1111

avatar image Kyren201 Jun 10 '17 at 10:44 AM

Hey, sorry for the long reply but real life got in the way and the like, do you mind giving me a hand with the fire function please, any tips and advice would be greatly appreciated

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

Hello Kyren201,

I think you should save all weapon settings in "DataTable". alt text

Later, if you choose which weapon can change it for him.

alt text

Or create child each of weapons.

weaponsettings.png (47.7 kB)
setsettings.png (96.8 kB)
more ▼

answered Jun 10 '17 at 11:06 AM

avatar image

Sertac Ogan
1.5k 30 10 46

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

If you are working with upgradable or dynamic weapons whose stats change over the course of the game, check out my response on this other question. I talk about how to make the parent class and use the parent weapon class to make changes the the child weapons and their stats.

more ▼

answered Apr 04 '18 at 12:01 AM

avatar image

128 4 6 9

(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