introduction.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!DOCTYPE html>
  2. <html class="writer-html5" lang="en" >
  3. <head>
  4. <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
  5. <meta property="article:modified_time" content="2026-02-18T13:11:11+00:00" /><meta property="og:title" content="Introduction" />
  6. <meta property="og:type" content="website" />
  7. <meta property="og:url" content="https://docs.crownengine.org/html/latest/units/introduction.html" />
  8. <meta property="og:site_name" content="Crown 0.62.0 Manual" />
  9. <meta property="og:description" content="Units: Units are the basic building block in Crown. A Unit represents a single logical object in the game world: a character, a light, a prop, and so on. A unit imported from a scene, a camera unit, and a unit representing a sprite., At the most fundamental level, Units are ju..." />
  10. <meta property="og:image" content="https://docs.crownengine.org/html/latest/_images/units.png" />
  11. <meta property="og:image:alt" content="Crown 0.62.0 Manual" />
  12. <meta name="description" content="Units: Units are the basic building block in Crown. A Unit represents a single logical object in the game world: a character, a light, a prop, and so on. A unit imported from a scene, a camera unit, and a unit representing a sprite., At the most fundamental level, Units are ju..." />
  13. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  14. <title>Introduction &mdash; Crown 0.62.0 Manual 0.62.0 documentation</title>
  15. <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
  16. <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  17. <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
  18. <link rel="shortcut icon" href="../_static/org.crownengine.Crown.svg"/>
  19. <link rel="canonical" href="https://docs.crownengine.org/html/latest/units/introduction.html" />
  20. <!--[if lt IE 9]>
  21. <script src="../_static/js/html5shiv.min.js"></script>
  22. <![endif]-->
  23. <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
  24. <script src="../_static/jquery.js"></script>
  25. <script src="../_static/underscore.js"></script>
  26. <script src="../_static/doctools.js"></script>
  27. <script src="../_static/js/theme.js"></script>
  28. <link rel="index" title="Index" href="../genindex.html" />
  29. <link rel="search" title="Search" href="../search.html" />
  30. <link rel="copyright" title="Copyright" href="../copyright.html" />
  31. <link rel="next" title="Creating Units" href="creating_units.html" />
  32. <link rel="prev" title="Units" href="index.html" />
  33. </head>
  34. <body class="wy-body-for-nav">
  35. <div class="wy-grid-for-nav">
  36. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  37. <div class="wy-side-scroll">
  38. <div class="wy-side-nav-search" >
  39. <a href="../index.html">
  40. <img src="../_static/org.crownengine.Crown.svg" class="logo" alt="Logo"/>
  41. </a>
  42. <div class="version">
  43. Crown 0.62.0 Manual
  44. </div>
  45. <div role="search">
  46. <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
  47. <input type="text" name="q" placeholder="Search docs" />
  48. <input type="hidden" name="check_keywords" value="yes" />
  49. <input type="hidden" name="area" value="default" />
  50. </form>
  51. </div>
  52. </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
  53. <ul class="current">
  54. <li class="toctree-l1"><a class="reference internal" href="../changelog.html">Changelog</a></li>
  55. <li class="toctree-l1"><a class="reference internal" href="../introduction.html">Introduction</a></li>
  56. <li class="toctree-l1"><a class="reference internal" href="../installing_crown/index.html">Installing Crown</a></li>
  57. <li class="toctree-l1"><a class="reference internal" href="../getting_started/index.html">Getting Started</a></li>
  58. <li class="toctree-l1"><a class="reference internal" href="../level_editor/index.html">Level Editor</a></li>
  59. <li class="toctree-l1"><a class="reference internal" href="../importing_resources/index.html">Importing Resources</a></li>
  60. <li class="toctree-l1 current"><a class="reference internal" href="index.html">Units</a><ul class="current">
  61. <li class="toctree-l2 current"><a class="current reference internal" href="#">Introduction</a><ul>
  62. <li class="toctree-l3"><a class="reference internal" href="#units">Units</a></li>
  63. <li class="toctree-l3"><a class="reference internal" href="#components">Components</a></li>
  64. <li class="toctree-l3"><a class="reference internal" href="#hierarchies">Hierarchies</a></li>
  65. <li class="toctree-l3"><a class="reference internal" href="#prefabs">Prefabs</a></li>
  66. </ul>
  67. </li>
  68. <li class="toctree-l2"><a class="reference internal" href="creating_units.html">Creating Units</a></li>
  69. </ul>
  70. </li>
  71. <li class="toctree-l1"><a class="reference internal" href="../rendering/index.html">Rendering</a></li>
  72. <li class="toctree-l1"><a class="reference internal" href="../physics/index.html">Physics</a></li>
  73. <li class="toctree-l1"><a class="reference internal" href="../gameplay/index.html">Writing Gameplay</a></li>
  74. <li class="toctree-l1"><a class="reference internal" href="../deploying/index.html">Deploying</a></li>
  75. <li class="toctree-l1"><a class="reference internal" href="../reference/index.html">Reference</a></li>
  76. <li class="toctree-l1"><a class="reference internal" href="../lua_api.html">Lua API reference</a></li>
  77. <li class="toctree-l1"><a class="reference internal" href="../glossary.html">Glossary</a></li>
  78. <li class="toctree-l1"><a class="reference internal" href="../copyright.html">License</a></li>
  79. <li class="toctree-l1"><a class="reference internal" href="../hackers/index.html">Engine Hackers</a></li>
  80. </ul>
  81. </div>
  82. </div>
  83. </nav>
  84. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
  85. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  86. <a href="../index.html">Crown 0.62.0 Manual</a>
  87. </nav>
  88. <div class="wy-nav-content">
  89. <div class="rst-content">
  90. <div role="navigation" aria-label="Page navigation">
  91. <ul class="wy-breadcrumbs">
  92. <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
  93. <li><a href="index.html">Units</a> &raquo;</li>
  94. <li>Introduction</li>
  95. <li class="wy-breadcrumbs-aside">
  96. <a href="../_sources/units/introduction.rst.txt" rel="nofollow"> View page source</a>
  97. </li>
  98. </ul>
  99. <hr/>
  100. </div>
  101. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  102. <div itemprop="articleBody">
  103. <section id="introduction">
  104. <h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
  105. <section id="units">
  106. <h2>Units<a class="headerlink" href="#units" title="Permalink to this headline">¶</a></h2>
  107. <p>Units are the basic building block in Crown. A Unit represents a single
  108. logical object in the game world: a character, a light, a prop, and so on.</p>
  109. <figure class="align-center" id="id1">
  110. <img alt="../_images/units.png" src="../_images/units.png" />
  111. <figcaption>
  112. <p><span class="caption-text">A unit imported from a scene, a camera unit, and a unit representing a sprite.</span><a class="headerlink" href="#id1" title="Permalink to this image">¶</a></p>
  113. </figcaption>
  114. </figure>
  115. <p>At the most fundamental level, Units are just numeric IDs that identify a
  116. specific object in a World. Units on their own are empty. You add Components
  117. to a Unit to give it behaviour and appearance.</p>
  118. </section>
  119. <section id="components">
  120. <h2>Components<a class="headerlink" href="#components" title="Permalink to this headline">¶</a></h2>
  121. <p>Contrary to some other engines, in Crown all Unit Components are optional,
  122. even the Transform Component can be omitted. This way you can have purely
  123. functional Units with no runtime cost.</p>
  124. <figure class="align-center" id="id2">
  125. <img alt="../_images/components.png" src="../_images/components.png" />
  126. <figcaption>
  127. <p><span class="caption-text">A “light” unit with its transform component displayed in the Inspector.</span><a class="headerlink" href="#id2" title="Permalink to this image">¶</a></p>
  128. </figcaption>
  129. </figure>
  130. <p>Units can have any number of components attached to them, but only one
  131. component per type is allowed.</p>
  132. </section>
  133. <section id="hierarchies">
  134. <h2>Hierarchies<a class="headerlink" href="#hierarchies" title="Permalink to this headline">¶</a></h2>
  135. <p>Units can be organised in parent/child hierarchies. This allows the creation
  136. of complex units from a number of simpler ones. To create a Unit with two
  137. lights, for example, you will create separate units each with their own Light
  138. Component, and then link the two together via a Transform Component.</p>
  139. </section>
  140. <section id="prefabs">
  141. <h2>Prefabs<a class="headerlink" href="#prefabs" title="Permalink to this headline">¶</a></h2>
  142. <p>A unit saved in the Project as <code class="docutils literal notranslate"><span class="pre">.unit</span></code> resource is called Prefab. Prefabs
  143. are a powerful way to reuse units. Prefabs can store not just a single unit,
  144. but entire hierarchies with all their components and properties.</p>
  145. <p>A prefab inherits all units and components of its base prefab, if any.
  146. Inherited units and components in the derived prefab can be removed,
  147. overridden, or complemented with new units and components.</p>
  148. <p>Modifications to a base prefab are automatically propagated to all derived
  149. prefabs.</p>
  150. <p>The prebab system can be used to implement many popular patterns and
  151. techniques. The most common use for a prefab is to leverage its inheritance
  152. system to implement OOP-style behavior; you could have:</p>
  153. <ul class="simple">
  154. <li><p>a base <code class="docutils literal notranslate"><span class="pre">enemy</span></code> prefab that defines the common geometry, animations and
  155. scripts;</p></li>
  156. <li><p>derived prefabs such as <code class="docutils literal notranslate"><span class="pre">enemy_heavy</span></code> and <code class="docutils literal notranslate"><span class="pre">enemy_fast</span></code> that override
  157. only materials, health values or behaviour parameters.</p></li>
  158. </ul>
  159. </section>
  160. </section>
  161. </div>
  162. </div>
  163. <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
  164. <a href="index.html" class="btn btn-neutral float-left" title="Units" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
  165. <a href="creating_units.html" class="btn btn-neutral float-right" title="Creating Units" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
  166. </div>
  167. <hr/>
  168. <div role="contentinfo">
  169. <p>&#169; <a href="../copyright.html">Copyright</a> Except where otherwise noted, content on this page is licensed under a CC-BY-SA 4.0 Int. License.
  170. <span class="lastupdated">Last updated on Feb 18, 2026.
  171. </span></p>
  172. </div>
  173. Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
  174. <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
  175. provided by <a href="https://readthedocs.org">Read the Docs</a>.
  176. </footer>
  177. </div>
  178. </div>
  179. </section>
  180. </div>
  181. <script>
  182. jQuery(function () {
  183. SphinxRtdTheme.Navigation.enable(true);
  184. });
  185. </script>
  186. <!-- Theme Analytics -->
  187. <script async src="https://www.googletagmanager.com/gtag/js?id=G-XNVGCMNDZH"></script>
  188. <script>
  189. window.dataLayer = window.dataLayer || [];
  190. function gtag(){dataLayer.push(arguments);}
  191. gtag('js', new Date());
  192. gtag('config', 'G-XNVGCMNDZH', {
  193. 'anonymize_ip': true,
  194. });
  195. </script>
  196. </body>
  197. </html>