Hello everybody!
I would like to know, for example, I want to put an object on the map, and if the player interacts with it (for example, presses E) an event occurs.
How do you keep track of all this?
Item tracking
What kind of an object would you wanna put? Anyways, OnPlayerInput or such hook, see if that is E ("Use" button), then raycast and see if it is the desired object.
For example, I want to interact with stops on the map, how to track them in the code, or how to do it so that I can work with them.
{
if (!input.IsDown(BUTTON.USE))
Merged post
What do you mean by "stops" on the map? And regarding Physics.Raycast, see Unity documentation and existing plugins.
That is what I mean, I want to open interaction with bus stops that are scattered around the map, make them work (so that the player can approach and interact with them) I do not understand how to describe this event in the code, and how to mark this object
You can always test by seeing what Raycast returns, what prefab name that is etc, and identify it the way you want (eg by prefab as mentioned above).
So how do I mark the object that the player should collide with?
what are you trying to say by "marking" the object?
Sorry if I'm not speaking correctly, I'm Russian, and I use a translator.
I need to put a stop, let's say on the shore, then I must mark it so that the player interacts with it, that is, I just need to get its coordinates, and put a mark for interaction?