Hi guys,
I was just wondering if it’s possible to use a raycast to detect if an object is in front of the player, then if there is an object there, increase an integer on a seperate script.
So for instance,
We have a gameobject with a collider called fire_place
We have an integer on the fire_place script called wood
We have a raycast coming from the player
The raycast hits the fire_place, and the wood integer increases.
Is that possible? If so can someone point me in the right direction to figure this out? Thanks.