Yeah I think I got it thanks!
Fixed it. Turns out that I just forgot to set a value for apply damage
Alright, last question for the day(although I donât need it answered today by any means )
Is there a way to increase the length of the sphere trace?
In the video below, I turned the visibility on and if Iâm too far then I canât reach the enemy so is there anyway to increase the length of the trace?
Also I just wanted to say that youâre an actual life saver, and thank you so much.
2023-01-10 23-21-09.mkv (13.5 MB)
No worries! Yeah itâs this node riiiight here:
Make sure to change the X and Y together! 100 = 1 meter. So right now itâs 10 meters.
Thank You!
Another snag Iâve run into:
If I attack an enemy multiple times then the orientation of my character goes completely out of wack. Do you know of a solution for this?
2023-01-11 21-26-38.mkv (19.2 MB)
Try this:
It grabs the Z of the hit actor and guarantees the jump location to be exactly the height of the enemy youâre attacking
If youâre lost, you can right click: Break Struct Pin to get most of these things
Worked like a charm! thank you so much! Very excited to keep working on this!
@Mind-Brain one thing I would like to incorporate is for my character to remain locked onto an enemy until the trace lands on another enemy that way I can fix the issue of nothing happening if Iâm aiming in between two enemies.
Hey again @Yamenisramen!
I covered that in that other thread, basically a ball around the character, so if you point in a direction that doesnât hit, it grabs the nearest one.
Another thing I would suggest is turning up your âRadiusâ on the first sphere trace (the one you already have) to something like 250 or 300. That should keep you from missing the enemy unless you aim in more or less the complete opposite direction.
I think I did it correctly! I attack the nearest one now. Thanks!
Is there a way I can edit the trace to where enemies who have just gotten attacked canât be detected by the trace for a few seconds? Because the current issue right now is that once I attack an enemy, I want to turn and attack another enemy, but the problem is that because I just attacked the previous enemy, Iâm right next to them meaning theyâre in my radius. Because of this even though Iâm facing another enemy, my character still ends up attacking the enemy that just got hit because theyâre still in my radius due to me being right next to them after landing a hit on them. Iâm thinking I can fix that by making it to where the trace canât detect an enemy after being hit for a few seconds, but Iâm not exactly sure how to do that.
Hey again @Yamenisramen!
Okay, so weâre gonna need screenshots now. I need to know what order things are happening in your targeting code! Because if your line sphere is coming before your big self-sphere, it should take priority. Which would allow you to point elsewhere. So your self-sphere should only go off if targetEnemy=null.
So as it is currently, youâre not using your second sphereTraceForObjects at all:
Itâs making a trace but youâre not doing anything with it. Which means your original trace might be too large, and is reaching behind you
Thanks for that! I set all the out-hit outputs and it made the trace actually do something
But, is there a way I can make it to where a pawn canât be traced for a few seconds after getting hit? That way, in practice, if a pawn is knocked back then he canât be hit for a short time.(Since it wouldnât make sense if I was able to hit him while the pawnâs getting knocked back)
Okay⌠so thereâs a way to do this but based on what weâve done so far itâs going to be tricky. So weâre going to put a boolean on your enemies, letâs call it targetable.
When an enemy gets hit, on their âOn any damageâ you need to turn that bool FALSE and start a âSet Timer By Eventâ. After that timer, Set Targetable = True again.
Now on your player character, after your sphere trace, youâll grab your targeted enemy and cast it to whatever your enemies are called. Drag off that cast, and âGet Targetableâ, then use a branch to check if true. If true, attack. If False, end it.
Thanks! Iâll try it out