I am making an adventure game similar to Skyrim, but holds true to MOBA game abilities (equivalent to smite in the 3rd person aspect)
Everything works great, and my script works universally for all objects that want to cast abilites (Such as AI mages, bloated zombies, skeleton archers, and the player, ect.)
I just have a daunting feeling that I did something wrong, and that my script layout is inefficient and n00b.
I’m just somewhat new to programming and it seems as if I’m passing around the same variables in a circle. The original GameObject that cast the spell is referenced (For locations/animator/uniqueness) in each step, and is then passed over to the next step. Is that normal?
You have a class that handles the casting, and another that handles the targeting. You need to pass the data to it so it can perform the targeting. That’s normal.
Design wise, this is normal.
As for HOW you pass that data around, and the implementation of this, I can’t judge that at all since I haven’t seen it.
When passing data from one object to another, I try to do it locally (Within function parameters). However there was no need for a function within splashtargettingcontrol.cs since it only exists when I need it, so I passed in the original game object through a public variable rather than as a parameter. I was a little concerned about how that would effect me in the future.
You’ve been a lot of help in making me feel confident about the system I am building my game on, your time is much appreciated Thanks!