This question is rather theoretical, because I’m trying to understand how to do stuff correctly, rather than writing actual code.
So, my question is:
I started a 3rd person C++ project and I wish to create a hunger zone.
I created my own player controller, and I created a class called Apple which has a property that determines how much hunger will be reduced when eaten. And of course, a hunger property on player character.
When I click on the apple, my click is detected by the Apple class.
Now, I wonder how I should go about it?
Should I create an Eat function on the player, and call it from the apple class?
or perhaps I shouldn’t even detect any clicks on the apple, but on the player, and then get the properties from the apple class, but do most of the logic on the player?
Any input on the issue will be much appreciated.