So I'm currently extending the killable script and am trying to just make a variable visible to the inspector so I can assign it there. However when I make the variable in script nothing becomes visible in the inspector. I'm sure this is some obvious noob issue that I'm missing... But what am I missing?
public GameObject otherGameObject;
Usually that makes it visible to the editor for me, but currently it is not. Any help would be appreciated.
So I have a certain attack that does chain damage. It does so by spawning a sphere collider and checking the tags of everything hit. So I need a way to spawn that gameobject when the enemy gets hit by that certain attack or gets hit by another of the previously spawned gameobjects. Thus creating a chainreaction amongst the enemies. But I have a lot of different skills and what the enemy spawns on hit should be determined by what they are hit with. If that makes sense. So I guess the way it would need to be able to be handled would be for my to be able to choose different things to spawn depending on how they are damaged. I don't know if thats possible as is right now.
Post by DarkTonic Dev on Apr 24, 2014 21:26:21 GMT
Probably instead of adding things directly to Killable, you should make a subclass of Killable. Then you can override key methods and leave the rest. This would not be overridden by CGK updates. Then if you need, you can make a custom inspector of your subclass type, starting with the Killable Inspector as a base.
So revisiting this question, but its more of a follow up question.
So let's say that I want to use a spawner to spawn all of those damage prefabs I was talking about for the spell that chains attacks through nearby similar units. I attached the TimeDespawn script to it so it kills itself off after .1 seconds. However what is the best way to handle spawning all of those prefabs. There are 5 different prefabs(The prefabs of the spell that I'm referring to are actually just colliders marked as triggers to check for proximity collisions of the spell) of this same type based on which unit was hit. So for example right now lets say there are 5 basic units. Each is a different color. When they get hit with the chain spell that matches their color they themselves should spawn the spell prefab of that color so the attack will chain through all nearby units of that color. Ideally I would actually pre spawn and then despawn like 20 of each color so if there is ever a big chain there would be no slowdown actually spawning new ones. So the question then is what is the best way to handle that? Do I need to have 1 spawner for each of the different color prefabs, Or is there a way to have 1 spawner that can handle all of the different colors even though they have to spawn a specific prefab depending on what color gets hit? Let me know if that question doesn't make sense. Thanks!
I would have 1 prefab (Triggered Spawner) for each color you need to spawn, then you can use the tag filters to only spawn a wave (even if it's just one item) when the correct color spell hits it (make sure you make tags for each color). Yes, prespawn all prefabs of all types by setting them up in Pool Boss.
Because you want logic to determine what you're spawning, this is the best way, without having to write any code.