- Home /
Duplicating GameObject with variations of the same functionality.
I've written a script that extends the MonoBehavior class. It essentially turns a game object into a "beacon", which can be selected, moved towards, etc. Each beacon should have unique properties like a name and other such information.
I'm new to Unity and unsure of how to do this, but how would one reuse that script and still give each object unique properties? In other object-oriented languages, we create instances of a class with a constructor, which takes care of my problem because the unique values can be specified there, but I'm not sure how to do the equivalent in Unity (C#) since I'm just creating a new game object, placing it on the map, and attaching my script to it.
Thanks!
Your answer
![](https://koobas.hobune.stream/wayback/20220612120224im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
An OS design issue: File types associated with their appropriate programs 1 Answer
Not every Class in the API is derived from the "Object"-Class, so what are they? 2 Answers
What's the difference between a struct and a class? 1 Answer
Does Unity support multiple Inheritance? 3 Answers
Does Unity support the declaration of several classes in one script? 2 Answers