Detecting Terrain grass

Hey Guys,

Making a survival game and want to allow the player to collect grass (plant fibre etc). Now I can see that the character is standing in a field full of the stuff, but how can I detect this at runtime?
This is the standard terrain detail type, no clever shaders or other convoluted workarounds.
Anyone know of a way to do this?
Cheers in advance.

Danny

In many first-person games, it’s normal to use a particular keyboard key to collect. That would trigger a swipe animation and, if the hand collided with something collectable (i.e. it has a tag or a component of “collectable”) then it is made inactive in the game and added to the inventory with an appropriate sound effect.

The reason I say that is that there is a lot to unpack there and certainly more than can be explained in a single answer. Which part are you after?

An alternative approach is to use a key to trigger a Physics.OverlapBox() which you can check for items in front of you. You’ll get an array of colliders and can sift through them for anything that is collectable. Again, is it the mechanic you would like a hint on or is it the full process?