How do I get specific Foliage Types out of an overlap?
I've just switched my game from a hand painted foliage system to a fully procedurally placed foliage system (using the procedural foliage volume). However one specific system, even though it works as intended, does more than it is supposed to do now.
The player is allowed to place buildings in the world and when a building passes all collision tests with other buildings, tress, rocks etc. it will be placed down and all the grass in a specific area (a collision sphere around the building) is being deleted. This still works, but since tress, rocks etc. are part of the same foliage system now (they weren't before) they will be deleted to.
So I somehow need to collect all the foliage that is colliding with my collision sphere and then get e.g. the foliage type to decide wether or not to delete the object or not. I've attached an image of the current system that just gets all the foliage elements and delets them no matter what. Does anybody have an idea how to easily expand this system to check for specific foliage types? So basically just collect the grass types, flowers etc. but not the trees, rocks etc.
edit: you can ignore the return node, itshould be connected with the completed port of the foreach loop.
This implementation is a quick test based on King Mango's suggestion. It works nicely. Like now I'm checking for my two specific grass types but I will change it so all the grass has the exact same prefix in the future. This way I can add whatever I want to the procedural foliage spawner and have it either be removable or not depending on the prefix of the material instance.
answered Dec 06 '18 at 03:14 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here