S
S
sudaID2017-01-05 13:59:40
Unity
sudaID, 2017-01-05 13:59:40

How to specify non-standard parameters for an object?

There is a scene assembled in 3D Max, the objects in it have their own names. There is a "button" object that, when interacting with the player, opens a certain door. There can be many such buttons and opening doors, but they are processed by one script. Moreover, for processing, the script only needs to know the name of the object that is "opened" by the button. Of course, the script itself is attached to each of the buttons as a component.
How to assign an additional string parameter to the "button" object - the name of the opened door? I have no doubt that Unity has such an opportunity.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sudaID, 2017-01-05
@sudaID

Understood. In order for a variable set in a script to appear in the Object Inspector, you must specify "public" before its name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question