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"

Sword Line Tracing and sword on character Anim

Hey everyone, i have been working on creating a Line trace based Melee combat inside Blueprint, and i'm still fairly new to UE4, i'm stuck on how do i get my character to hold the weapon while also working only during the animation, that being the Line Trace hit detection, i'm trying to replicate Melee combat like Chivalry Medieval Warfare, to give more insight, right now i only can get the Line trace working by making it go forever or click spamming my left click, and only when i got the sword inside the "Mycharacter" which isn't attached to the Characters socket, i would like to get my weapon attached to that socket but also being able to create the Line Trace Hit detection with my sword only during the attack animations ( just like CMW), mind you this is in the 3rd person Template as well, and if someone knows how would i go about switching weapons as well, thanks =)

Main things: Line Trace hit Detection Getting Weapon onto socket while allowing me to use it to attack with Line Trace hit detection and Switching to a different weapon that uses Line Trace hit detection as well. ^.^

Product Version: Not Selected
Tags:
more ▼

asked Mar 24 '15 at 10:42 AM in Blueprint Scripting

avatar image

Kraxiuspvp
1 2 4 3

avatar image eXi Mar 24 '15 at 11:23 AM

Ok, so you know how to attach your sword to the socket already?

So you have an attack animation. What you can do here is creating "Animation Notifies":

https://docs.unrealengine.com/latest/INT/Engine/Animation/Sequences/Notifies/index.html

You can create two, one for start, one for end of your linetrace. Then just toogle a bool that control the line trace (:

avatar image Kraxiuspvp Mar 24 '15 at 11:40 AM

alright, so am i making two Anim Notifies or Sockets, my weapon is seperate from the character model with two sockets Start and End which creates the Line trace, just like Chivalry, if you wouldn't mind explaining a tiny bit about how would i go about making it work, as i said before i'm still fairly new to UE4 but very much keen on learning how it all works =)

avatar image eXi Mar 24 '15 at 11:50 AM

Sockets != Anim Notifies.

A Socket is a place at your character skeletal mesh that adopts the movement of the specific Bone you choose for it.

For example a Hand Bone. You can then attach your sword to the socket and the sword will move like the Hand Bone does:

https://docs.unrealengine.com/latest/INT/Engine/Content/Types/SkeletalMeshes/Sockets/index.html

Normal way would be to let the sword attach itself to the actor in Begin Play or something like that by using "Get Player Character" and getting his skeletal mesh for the Attach Node. Then you can add the Socket Name you have chosen earlier and "Snap to Target" to have the Weapon Blueprint stuck to your character. (The Attach nodes can be found at the bottom of the Socket page i linked you).

Now for the animation notifies:

These are created in the Animation Editor. When you open your Skeletal Mesh, you can see a tab "Animation" at the top right corner. There are all your animations. You can there click on the sword swing animation of your character and create 2 animation notifies at the points where you really want to enable and disable the line trace. The page i linked in the other comment should help you, otherwise ask me for help again.

With these notifies, you can go into the Animation Blueprint and in its event graph you can get these Notifies as events. So as soon as your Animation hits the notify, the event will be called. With this you can change a bool in you sword BP or character BP (depens on your setup). This bool will then just enable or disable the line trace with an easy branch.

avatar image Kraxiuspvp Mar 24 '15 at 11:57 AM

alright, i will see what i can do though i have one more question since i'm a little confused i have a hand socket for my character, and the Two sockets made on to the sword, will my two sockets on my weapon still be valid? or do i some how need to create one on the character's skeletal mesh instead of the swords one i created to follow the Hand Socket?

avatar image eXi Mar 24 '15 at 12:24 PM

I don't know for what do you want to use these two sockets, but yes they are still valid.

An easier way to apply damage with a sword would be creating a box collision that fits the shape of the sword and just enable and disable it with the notifies.

avatar image Kraxiuspvp Mar 24 '15 at 01:12 PM

well as i mention'd before i use these two sockets on the sword to create the Line Tracer, Socket "Start" and socket "End"

avatar image Kraxiuspvp Mar 24 '15 at 01:13 PM

Socket start is at the bottom of the blade and end at the top

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

0 answers: sort voted first
Be the first one to answer this question
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