I can Attach static and Skeleton mesh to character adding the component in the character BP but my questions is what if i want a lot of skeleton meshed weapons what do we do …surely we don’t add a million skeleton meshes in the character. If any one could assist with this please or have any examples showing the process of adding multiple weapons this would be great
Do you require to have a lot of weapon meshes at once added to it?
not at once but I wanted to have a good variety of changeable weapon meshes and at the moment iv added two weapons to the character using the skel mesh however i guess this method wouldnt work if you wanted a good variety of weapons. Also what would you do if you had a inventory of meshes surely they all cant reside in the character??
Thanks Moss for the reply’s … what you’ve said is what i’m after but i’m a little new to unreal well it all to be honest… having only been doing it a few months… Do you have anything like links or visuals to assist with the basics of this? So I guess the 1st thing to do is spawn a weapon/weapon class as actor. how do you then attach weapon to character would this be attach to or attach actor to component node + im only using bps not c++… I appreciate the time taken to reply and any further assistance. Cheers
I would store an identifier for the weapon and spawn the weapon itself as an actor in run-time. Not just a mesh, this way you will be able to have custom logic on the weapon and you can have tons of them. You could for example just store the weapon BP class name (a reference to the BP or even a string) the character is holding.
For networking you could than spawn the weapon representation on each client (you do not need the whole logic, just create a proxy object that replicates the effects). For instance a client does not require to know about the number of bullets the other has in its magazine, this way you just use the data required to do all visuals and safe some bandwidth.
The weapon system that is used in the ShooterGame example follows the same principle (and the new Unreal Tournament too I guess.
You can spawn a weapon actor and then add the desired mesh depending on the weapon class, in the construction script of the BP class for example. After spawning you can then attach the actor itself to a socket/bone of your character. There should be a BP method like AttachActorToSocket or Bone (or simple AttachActor, I have no editor right now).
With this you should be able to start achieving your goals.
Cheers,
Moss