|
Post by frostamation on Jan 16, 2015 15:55:22 GMT
I have a killable on bullet and enemy. The tags for which damage can be done to the killables are, bullet can damage themselves(needed for rare instance of them coming in contact with each other) and bullet can damage enemy and enemy can damage bullet. So the bullet has two tags: bullet, enemy and the enemy has one tag: bullet. Now this was working correctly and for some reason has stopped, with no errors in the console. But now the bullet no longer triggers the explosion prefab when it comes in contact with the enemy or with itself, after checking when i pause the game and i click the bullet and click "do one damage" it will despawn the bullet and spawn the explosion prefab, so it would seem as though its no longer receiving the damage from the enemy.
The setup has everything that is needed, i have also remade the bullet and the enemy from scratch, redid all the scripts etc, and still have the same result of the explosion prefab not working. Any thoughts or suggestions to try to get it working again appreciated.
On a side note once the enemy is destroyed, which is currently set to happen after two hits, does work. when the enemy dies it spawns its explosion prefab and updates the experience world variable inside cgk. so for some odd reason it seems the killable on the bullet isnt functioning but the killable on the enemy is?
|
|
|
Post by DarkTonic Dev on Jan 16, 2015 17:29:48 GMT
For the Killable that isn't working properly, turn on the "Log Events" checkbox in the very top section. It should tell you why it isn't working properly. Fix a single bullet while troubleshooting so you don't get spammed in the Console.
Usually what happens is the "Ignore offscreen hits" box defaults to on, and your renderer isn't in the same Game Object as Killable, but a child instead. If that's the case you'll need to use the KillableChildVisibility component on the child, or turn off Ignore offscreen hits.
Hope that helps!
|
|
|
Post by frostamation on Jan 17, 2015 0:47:19 GMT
I keep getting "Invalid hit because layer of other object is not in the Layer Filter." and/or " Invalid hit because tag of other object is not in the tag Filter." but it is in the tag/layer filter.
after some testing i found out that each object has to have/be in the same tag/layer as the filter, so if i have bullet tagged as bullet and im using a layer such as terrain, the bullet has to have tag of bullet and layer of terrain in order for the killable to work, is this the way it is supposed to work? I thought i could use both the tag and layer system as independent things such as if an object has a "tag of" or "layer of" do this...
|
|
|
Post by DarkTonic Dev on Jan 17, 2015 1:05:03 GMT
I keep getting "Invalid hit because layer of other object is not in the Layer Filter." and/or " Invalid hit because tag of other object is not in the tag Filter." but it is in the tag/layer filter. after some testing i found out that each object has to have/be in the same tag/layer as the filter, so if i have bullet tagged as bullet and im using a layer such as terrain, the bullet has to have tag of bullet and layer of terrain in order for the killable to work, is this the way it is supposed to work? I thought i could use both the tag and layer system as independent things such as if an object has a "tag of" or "layer of" do this... Yes that is how it's supposed to work. They are both independent. Don't use layer filter unless you want to limit combat to certain layers. Don't use tag filter unless you want to limit combat to certain tags. Usually you wouldn't use both at the same time on the same Killable, but sometimes you might want to, but yeah it means it has to match both layer and tag. We only use the layer filter for our games. You probably should just make a layer for "player weapons" and use that instead of using the tag filter.
|
|