Hey guys! I’m currently trying to make a script in C# for the enemy to chase the player and play an attack animation when it gets withing a certain distance. Everything in the code works except for a small error I am getting.
Error CS1955 Non-invocable member ‘Enemy_Chase.chaseTarget’ cannot be used like a method.
It’s on line 32.
I’m not quite sure what I did wrong or what that means, i’ve been following a tutorial and his code seems to work. Here’s a link.
Any help is greatly appreciated as i’m really new to coding. =)
This error is telling you that chaseTarget is not function but a boolean (defined at line 11). You can’t invoke a boolean, it just does not make sens. However, there is a method with a capital ‘C’ (ChaseTarget), I guess is that function you want to invoke.
Also, you don’t need to take screenshots to post your code, just copy/paste it by using code tag.
Thank you! This seemed to work great! =) I will have to pay attention to my wording next time.
As for the posting a code, i’m glad you guys said something. I couldn’t quite figure out how to insert a code without a screenshot. Now this should be a lot easier.
Have a great one my friends!