Hi everyone,
I am puzzled by how the structure for these chapters have been architected, specifically for the lesson “Implementing Action Priority”. Wasn’t it better in terms of performance to have a simple raycast in the update loop, and depending on the Tag of the object that has been hit, implement a switch case?
The way you are doing is to getComponent at every frame to check if there’s a CombatTarget, and if that’s null, you ignore it. Wouldn’t it be better to make the raycast upon the mouse click, and only then check if the tag corresponds to enemy/floor?
thanks for your attention!