Sorry about the wait, Yuri, I had to go to work.
As it turns out, there were still two issues outstanding with the code. Both of these were in PlayerController.cs, and are easy to miss at first glance.
The first thing I noticed was within the InteractWithCombat method… you have a line
if( target = null) continue;
This is an assignment rather than a comparison, so regardless of the status of target, it will be assigned to null within the if statement. (This is actually a common typo, but still hard to spot sometimes). The correct syntax is
if(target==null) continue;
So I fixed that in the code and it was still misbehaving, and not giving any logs to demonstrate that it ever was even entering InteractWithCombat… that’s when I went back to the Update Method… your code has InteractWithMovement before InteractWithCombat…
Unless the cursor is completely outside of the terrain, InteractWithCombat will always return true, so it needs to be the last if statement in your Update() method, not the first. Swap the order, so that InteractWithCombat is first, and everything should be right as rain.