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"

How do I add a simple melee attack animation to my 3rd person player?

Hi guys & gals!

I am trying to make a third person game these days and managed to set up some basic animations (idle, run, jump) in my character animation blueprint. Based on variables from the event graph, my character can now do exactly what the third person template character can do, but now I also need to add some additional animations like various melee attacks and randomized idle animations.

I have read through the docs and tried various methods, but I just cannot understand how to do this. As far as I understand, I would have to get/create a variable in the event graph and then pass this into my animation graph, right? I just can't seem to figure out how I can get an input event (left mouse click?) to trigger an (additive?) animation and I am about to lose my sanity.

Could anyone please point me in the right direction?

All the best,

Roald

Product Version: Not Selected
Tags:
more ▼

asked Apr 03 '14 at 01:30 PM in Blueprint Scripting

avatar image

brokenpoly
156 17 21 225

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

1 answer: sort voted first

You would first need to create an anim montage. You do that by right clicking on your animation and selecting "Create Anim Montage"

alt text

Open up the montage and you will be able to set the name of the slot. Call it "FullBody"

alt text

Now go to your anim blueprint > animgraph and set up the SlotNode in between the state machine that runs the idle and run animations and the Final Pose Node. Make sure to call the slot FullBody.

http://i1188.photobucket.com/albums/z411/TheAgent007/animgraph.jpg

Now in your characters blueprint you can play animations this way.

http://i1188.photobucket.com/albums/z411/TheAgent007/Playanim.jpg

If you would like to have it play in code, its a different set of things you have to do.

createmontage.jpg (92.3 kB)
slot.jpg (48.7 kB)
more ▼

answered Apr 03 '14 at 01:43 PM

avatar image

TheAgent
109 4 10 16

avatar image brokenpoly Apr 03 '14 at 02:40 PM

Thank you very, very much for the quick reply!

I managed to get it working, well, sort of, but the question now is how I can only affect the upper body of my character? Right now, the entire character blends into this new animation, which is unfortunate, so I wonder how I can make my player run and play this animation at the same time?

This is how it looks now btw:

https://www.youtube.com/watch?v=dtqnBn7fFR4&feature=youtu.be

Thanks again!

All the best,

Roald

avatar image TheAgent Apr 03 '14 at 02:45 PM

You can create another node and call it TopHalf slot. Set the bone to use where it starts blending the top half anim. In my case it starts at b_Spine1.

Make sure the anim montage has the slot name set to TopHalf.

You need to copy your state behavior so that it blends with it like in the image.

Then connect the nodes like so :

alt text

tophalf.jpg (266.0 kB)
avatar image brokenpoly Apr 03 '14 at 03:04 PM

That seemed to do the trick :) If you ever visit Norway, I`ll buy you a beer or three :) Thanks a lot!

Now I just gotta figure out how this melee animation could inflict damage on enemies.

Thanks again!

Roald

avatar image JavierRamello Jul 18 '14 at 10:35 PM

I'm sure you already found a way, but for anybody looking for a tutorial about how to inflict damage I would like to share this basic one:

http://javierramello.com/index.php/tutorials/51-unreal-engine-4-damage-collision-box

I hope it helps!

avatar image TheAgent Apr 03 '14 at 03:16 PM

Ha no problem!

(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