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"

Easier way to switch through animations?

Well, I'm doing a weapons system and each weapon will have 4 animations: Idle, walk, run, and shoot.

Except, these aren't weapon animations at all; they're all in the character's arm. The problem is, the BP is gonna get pretty huge.

I mean here's just part of the 'event tick': alt text

And here is the shooting script for just the pistol: alt text

Now if you look at the components, you could see how messy it could get after 4/5 more weapons. And the whole arm animation system is broken at the moment and I'm trying to figure out how I'm going to go about doing the weapon switching system, too.

So is there an easier way to handle all of this? could I possibly handle the weapons in another BP yet still have it connected to the players arm? How to other developers handle weapons and arm animations?

Product Version: UE 4.16
ue41.png (328.1 kB)
ue41.png (381.1 kB)
more ▼

asked Aug 10 '17 at 04:51 PM in Blueprint Scripting

avatar image

67 7 12 11

avatar image Krilium Aug 10 '17 at 04:55 PM

EDIT: There will be a reload animation and system too and I am NOT looking forward to doing that lmao!

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

1 answer: sort voted first

Ok so I'm making some assumptions based on the setup I can see in these images so forgive me if I am telling you things you already know.

The first thing you should be looking into is Animation Blueprint, this is where all the animation logic should be handled by any skeletal mesh. I'm assuming your gun is broken down into that many pieces because it has complex moving parts and you need it to animate. If this is the case it would be worth looking into making it a skeletal mesh with animation rather than moving the parts with timelines. If you socket your weapons to the arms then they will inherit any movement from the arm animations and you don't have to worry about adding that yourself.

When I make a weapon or any other prop that can be carried I always think about how it works before I decide how it is constructed. A knife for instance has no moving parts and therefore it will be brought in as a static object that can be socketed directly to the player and it will inherit the movement just like the real world. A gun still needs to inherit those movements but it has moving parts within it's frame and so it needs a skeleton to drive those movements, and I would create them as a skeletal mesh.

As far as keeping the logic contained in smaller packages you can create an actor blueprint for each of your guns and then add it to your first person character blueprint as a child actor component. This way all it's logic is handled indpendently of the user but it's values can still be accessed through the character blueprint. You could even create a weapon class that has most of the logic and then create children for each of the weapon types so that you don't have to create all the logic for things that everyone weapon will have like weapon effects and you can just overwrite the effect that you want.

I know that is a lot of information to ingest so hopefully you get something from it.

P.S. As a general rule it is good practice to not put any logic on tick unless absolutely necessary. If you need something to fire regularly, look into using timers instead. They are more versatile as they can have their intervals set and they can be turned off when not needed.

more ▼

answered Aug 10 '17 at 11:20 PM

avatar image

Ruffhaus Games
663 13 9 23

avatar image Krilium Aug 11 '17 at 09:46 PM

Saving this answer for later, thank you very much!

I sorted the AnimBP for the Arm_Pistol earlier, it definitely cleaned up the whole Character Blueprint! Only problem I'm having now is that if you shoot fast enough, the shooting animation doesn't reset, so the arm doesn't move. I tell you what though, these animations are really smooth now that there's a blendspace involved!



avatar image FredPoissant Apr 16 '18 at 07:27 PM

Hi Krillium and Ruffhaus Games,

I'm working on a third person action myself and I found that having an actor class BP_BaseRangedWeapon to store the basic presets and then creating child blueprints for each weapon types helped me a lot!!

I still have a question for Ruffhouse Games: When you switch weapon, to switch the animations, do you use a switch on enum for every arm animations in your graph or do you rather switch arm graph? I also though about having an anim graph for every weapon type (Because I also have melee weapons that change the lower body anims as well) but that seems heavy.

How would you tackle this problem?

avatar image Ruffhaus Games Apr 17 '18 at 04:17 AM

This is a fairly different question, and would probably be worth asking separately to get a wider range of opinions, but the answer really is, it depends.

My opinion on it is if the weapons are varied enough to need a full suite of animations for each weapon type I probably would use a bunch of state machines in the anim blueprint that are controlled by a blend that is run off an enum, so you retain a lot of the shared logic. Alternatively you could also make child animation blueprints and switch which animation blueprint is being used in the character depending on what weapon they have equipped.

(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