- Home /
Who has the brains Player or object to be picked up
This is regarding 3rd person character setups
Say there are apples on the ground that the player wants to pick up how would the process go?
Should the apple have a trigger collider and be waiting to detect the player. Or should the player have a trigger and be waiting to detect the apple.
This also applies to interactions with doors and such. Should the player have a collider(or since doors are bigger a ray could be used) that when it is triggered will check the objects tag and tell the object to do it's thing(for doors it would be to open and close and objects(like apples) it would be to be added to an inventory).
What are some other methods, and is there any big positives or negatives such as one is more performance expensive. Is one method better if the game is single player while another is better for multiplayer.
Thanks for your answers.
This is a very open-ended design question(s), so it not really suitable for UA. There are no "correct" responses to anything you wrote.
This sort of open ended question should be asked in the forums. Unity Answers is for answering questions about specific technical problems.
Answer by meat5000 · Oct 30, 2013 at 09:30 PM
The player has to know he can pick up apples. The apple has to know it can be picked up.
The nature of the object should be with the object, naturally.
You have some buttons. Does the player that presses them determine what they do? No. The player must know he can press them. The buttons must determine what they do for themselves.