Anyone has any advice for implementing a spell targeting system?
Targeting such as point or GameObject.
Which aspect are you struggling with? Spell targeting system is rather vague.
The entire implementation pretty much.
The way my current spell system is set up is that I have a bunch of small ability scripts which can then be plugged into a main ability script. The player can then activate the main ability which activates all small abilities inside it. The problem is that I’m passing the target as an object and then all abilities will cast the object as either GameObject or Vector but I’m thinking down the line this could cause incorrect casting exceptions.
EDIT: I think the dynamic keyword will help me a lot. I plan on always passing a point as a target (so whenever the user presses a key for example, the point the mouse is on will always be passed as a parameter to a function in the Targeting class of an ability which will dynamically return a GameObject or Vector based on the point the mouse was on when the ability was casted.