Line Trace By Channel, Animation Problem

Hallo,

I made a linetrace like in this video UE4 Sword Swing Hit Detection - YouTube

I said when the player hit a compenent “stop mesh” but the problem is, my animations are too fast, so the player moving a litl more and then stops. but this is very bad.

Pls Help. Thx.

Hey there, i didnt really understand your problem, can you elaborate?

Hi I guess you have follow the guide on Reddit about this. Reading your answer I can guess you have followed the delay method instead of the tick one, or your mesh is a pretty too big and the result is bad.

In case 1) Try to use this setup (but add a branch that stop the attack if line trace collides).

http://i.imgur.com/q0HJK7g.png

In case 2) Try to use put socket more on the edge of the blade, if you use multiple animations and both edges can hit I suggest you to use two sockets, one for each blade’s edge.

Hope it could help! Have a nice day!

P.s: reddit credits (https://www.reddit.com/r/unrealengine/comments/34d3qx/using_blueprints_how_do_i_implement_a_trace/)

Hallo,

My Problem is, the speed of the animation. if i play the animation in slow motion, he stops at the first place! Also the system is right, but if it is too fast, he just continue to move and stops . later. which is a big problem for me.

How can i make his reactions faster? or is it even possble?

Thx

If you are managing the collision in event tick I’m afraid is the framerate and you can’t almost do nothing.

Every tick in “event tick” is calculated at the start (or end, i don’t remember) of the frame [tbh is the opposite], so if your game is running at 30 fps the event tick enter 30 times, 60 fps → 60 event tick etc. This is the max frequency you can run a script.

Assuming the swords collides at the 20th frames of second X: at frame 19 the sword is in a position where linetraces don’t hit, at tick 20 the sword is in the position you have posted and the linetraces hit, so is a little too late because the right position isn’t processed.

If it’s hard to imagine or understand pretend that the game is an image slideshow and before every slide the script you wrote runs. Higher is your fps, minor is the time that occurs between photos.

You should check how many fps you have (in the viewport click on the cute little arrow in the right top corner and check show fps) and try to get them higher as possible to get good results.

If they are low you can check what are causing troubles opening the command console and typing stats UNIT.

If you still have problems post me a print screen of the BPscript you are using for the traceline in order to help you more!