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"

Switch Weapon Sytem

Hi guys

I need help for create an switch weapon system. I would like to exchange weapons with another of a button . for example if I have a gun in my hands and i press "E" before a sniper , my gun fell to the ground and I get it in my hands sniper.

Plz help me , thanks

Product Version: UE 4.8
Tags:
more ▼

asked Aug 09 '15 at 01:02 AM in Using UE4

avatar image

chaanks
1 1 2 3

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

2 answers: sort voted first

There are many ways to setup a weapon switching system but what would likely be the easiest to setup would be as follows:

  • Attach all your weapons to your mesh in your Character Blueprint

  • Hide all but the default weapon

  • Create an int variable called Current Weapon Index

  • On "Next Weapon" button pressed increment Current Weapon Index and mod (%) it to the total number of weapons

  • Plug Current Weapon Index into a Switch Node to change the visibility of all your weapons so that only the weapon you want to show is visible. If the Firing event is on the weapons themselves you might also need to toggle Enable Input as well.

I would suggest starting very simple and then slowly add in logic such as animating this process, adding and removing weapons, etcetera.

more ▼

answered Aug 09 '15 at 01:32 AM

avatar image

IanLaBrie
606 21 8 34

avatar image chaanks Aug 09 '15 at 10:47 AM

thanks for your réponse lanlabrie but my project is when i kill an anemy , he can drop random weapon and i would like trade my weapon with that weapon. Your idea is cool but can't work whith my project :s

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

thanks for your réponse lanlabrie but my project is when i kill an anemy , he can drop random weapon and i would like trade my weapon with that weapon. Your idea is cool but can't work whith my project :s

more ▼

answered Aug 09 '15 at 10:12 AM

avatar image

chaanks
1 1 2 3

(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