Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by bridged · Jul 17, 2012 at 08:06 PM · gameobjectclassinstance

Is every Script I drag on a Gameobject an instance?

Hey,

When you usually program in C#, you can make a class

public class myClass : typeOfClass { }

What I dont understand (I also checked this site) is:

Is every Gameobject which I put my Script on an instance of the class that is defined in the script?

Im sure it is like this, but I really would like to also hear it from someone else =)

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image fafase · Jul 17, 2012 at 08:20 PM 0
Share

The way I see it, which could be totally wrong though, a game object has a whole bunch of inherited classes (Object, Behaviour,Vector3, Collision,...) and when you add a script you add a new class to it with its own variables and functions.Difference is the other objects do not inherit it. This is my simplified vision, obviously it is a little more than that.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by rutter · Jul 17, 2012 at 08:08 PM

Each component on a GameObject represents an instance of that component type. So, yes.

This can lead to complications if you need some way to tell them apart, but there's usually some way to manage it.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image bridged · Jul 17, 2012 at 10:54 PM 0
Share

allright, that's what I wanted to hear and the same thing u just said about telling them apart is one thing that was confusing me because you do not really name them. But from the aspect that they ARE instances I can imagine that they and how they are differenced.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to add new instance of a script to a game object? 2 Answers

Enter Class(method) with a script, attached to another Object 2 Answers

How to add an existing script instance to a GameObject 2 Answers

Restricting "Drag GameObject" script to Z Axis? 1 Answer

Script Execution Order doesn't affect derived classes. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges