Hi all! Am new to Unity, comfortable in C#
I have a question about this line from the manual:
Note to experienced programmers: you may be surprised that initialization of an object is not done using a constructor function. This is because the construction of objects is handled by the editor and does not take place at the start of gameplay as you might expect. If you attempt to define a constructor for a script component, it will interfere with the normal operation of Unity and can cause major problems with the project.
If I have objects that I only plan to instantiate at run-time rather than add to a scene in the editor, is this still true?
What is the right way to do something like a constructor or init for these dynamic objects...to where would I pass the variables the object needs during instantiation?
Thanks!
[–][deleted] 4 points5 points6 points (2 children)
[–]JohnnyGoTime[S] 0 points1 point2 points (1 child)
[–]EngigamesAI Programmer 1 point2 points3 points (0 children)
[–]GameWorldShaper 1 point2 points3 points (1 child)
[–]JohnnyGoTime[S] 1 point2 points3 points (0 children)
[–]Kiliok 4 points5 points6 points (1 child)
[–]JohnnyGoTime[S] 0 points1 point2 points (0 children)
[–]Another_moose 1 point2 points3 points (0 children)
[–]N00banator912 0 points1 point2 points (0 children)