Announcement

Collapse
No announcement yet.

Weapon system

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Weapon system

    So last few weeks I have been trying to create a weapon system. I just wanted to ask are there more ways how to do it besides adding child actors to the character bp and setting up enum for the weapons(also doing this way character BP holds all the weapons info). I am afraid to use this method because I will have a lot of weapons which can be picked up like in H1Z1/DayZ and I really didnt like when you have to hide every weapon if it's not being used. TLR how to cast several weapon classes + mesh to the character? Because currently I have fire/sounds/animations inside the weapon BP and if I move everything to the character BP it will just be messy.

    #2
    Yes, you can easily use SkeletalMeshComponent in the hands of your Character. When you switch Weapons, simply exchange the mesh of the weapon. You should separate the physical representation of the weapon and the logic of it.

    The best way is to use either an interface or an abstract class for the functionality for weapons. This way every weapon can be used the same way, but may have different behaviour.

    €dit:

    In my Project, weapons are UObjects, not AActors.
    I have a separate Actor for Pickups and the UObject Weapon implements an interface, that returns the Mesh.
    Last edited by Raildex_; 12-13-2016, 05:33 AM.

    Comment


      #3
      I have tried creating an object before and assigning a class to it but it didn,t work. I am using interface for weapon equip animation so I will try using the interface for different weapons first. Btw, do you have some demo to share by any chance? if not, maybe you have seen a tutorial on how to do it?

      Comment


        #4
        Here's one I always liked but that's for real-ish switching of weapons:
        https://youtu.be/H7RXkl8QtTk

        Alternatively you could check this out:
        https://youtu.be/w_8jl3mkGio

        Comment


          #5
          Thanks for your input.
          I already have the 1st system implemented. I've seen the second one but I wasnt sure if I will be able to use it as I want to. But if you think that the second one is a good example on how to handle a lot of weapons I will try to do something.

          Comment


            #6
            I store the Animations of the character in the weapon itself and use a State Maschine with these Animations concurrently to the base Animations.
            Every Weapon has an Animation for Drawing, Aiming, Shooting, Idle and Holstering.

            Comment

            Working...
            X