<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
  <channel>
    <title>Udvikleren.dk - Seneste [unity3d] forum tråde</title>
    <description>De seneste forum tråde i [unity3d] på Udvikleren.dk</description>
    <link>http://www.udvikleren.dk/</link>
    <pubDate>Wed, 29 Apr 2026 01:55:33 GMT</pubDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Udvikleren.dk RSS Feeder</generator>
    <ttl>60</ttl>
    <item>
      <title>Hvad en vertex/fragment shader og mapping af periferi syn til skærm?</title>
      <description>Hej &lt;img src="/images/smileys/smiley.gif" alt=":)" title=":)" /&gt;&lt;br /&gt;&lt;br /&gt;Jeg er i gang med at læse om grafik (3D/2D) og om spiludvikling. Jeg er stødt på nogle ting, jeg ikke lige forstår, og håber i kan hjælpe med&lt;br /&gt;&lt;br /&gt;Hvad er en vertex shader og en fragment shader?&lt;br /&gt;&lt;br /&gt;Mit bud: En vertex shader "leger" med positionen af et spilobjekt og dets output er et fragments shaders input. Et fragment shader "leger" med hver enkel pixel's farve.&lt;br /&gt;&lt;br /&gt;Mapping af periferi syn til skærm?&lt;br /&gt;&lt;br /&gt;Har ikke et bud på hvad det er &lt;img src="/images/smileys/smiley.gif" alt=":)" title=":)" /&gt;&lt;br /&gt;</description>
      <link>http://www.udvikleren.dk/forum/47058/hvad-en-vertex-fragment-shader-og-mapping-af-periferi-syn-til-skaerm/</link>
      <pubDate>Sun, 18 Dec 2016 13:46:21 GMT</pubDate>
    </item>
    <item>
      <title>Team/Hold vedrørende spiludvikling</title>
      <description>Mit navn er Erik. Jeg er imidlertidigt en STX studerende, der læser Bioteknologi. Min nuværende alder er 19 år. Jeg har læst meget omkring programmering, siden jeg var 13-14 år gammel. Jeg har fuldført en masse små og simple projekter. Jeg har læst og prøvet en masse programmerings sprog (HTML, Lua, Java, C#, C++). Har dog også moddet til forskellige spil. Før i tiden havde jeg fokuseret meget på C# og frameworket XNA. (Jeg vil dog gerne videre til C++ og SDL eller andet). Der skal huskes, at sige, at jeg aldrig har haft nogle former for undervisning. Jeg har gjort dette som en hobby og derfor er jeg overhovedet ikke i niveau med individer der studerer faget.&lt;br /&gt;&lt;br /&gt;Jeg har været igang i en måned med et projekt, som jeg midlertidigt kalder for "VillageWars".(Unity3D).&lt;br /&gt;Jeg har selv modelleret og programmeret spillet, men jeg er nået til det punkt, hvor jeg føler at jeg har begrænsninger. De begrænsninger kommer af, at jeg er alene om projektet og at min viden omkring programmering ikke rækker uendeligt langt. &lt;br /&gt;&lt;br /&gt;Her kan i se et par billeder af projektet.&lt;br /&gt;(Modeller)&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/01%202.png" rel="nofollow"&gt;Image 1&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/02.png" rel="nofollow"&gt;Image 2&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/03.png" rel="nofollow"&gt;Image 3&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/04.png" rel="nofollow"&gt;Image 4&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/05.png" rel="nofollow"&gt;Image 5&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/06.png" rel="nofollow"&gt;Image 6&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/07.png" rel="nofollow"&gt;Image 7&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Procedural Terrain Gen)&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/progressofit.png" rel="nofollow"&gt;Image Game 1&lt;/a&gt;&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/islandgen.png" rel="nofollow"&gt;Image Game 2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;(Start concept)&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/Sk%C3%A6rmbillede%202015-02-18%20kl.%2020.21.01.png" rel="nofollow"&gt;Image Game 3&lt;/a&gt;&lt;br /&gt;(Hvordan det ser ud nu) (Ikke helt tilfreds)&lt;br /&gt;&lt;a href="https://dl.dropboxusercontent.com/u/38743341/Sk%C3%A6rmbillede%202015-04-04%20kl.%2013.14.09.png" rel="nofollow"&gt;Image Game 4&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Jeg har nu længe ønsket mig at kunne starte en form for gruppe/virksomhed op sammen med en gruppe personer som også har nogle af de samme interesser for spiludvikling. Jeg ønsker derfor at samle et hold, for at kunne udføre større projekter. Jeg søger derfor programmøre, grafikkere, designere osv. Jeg ville have stor glæde af, at have en programmør på teamet, for mit niveau inden for programmering ikke er særlig kompleks.&lt;br /&gt;&lt;br /&gt;Jeg forventer forhåbenligt, at kunne skabe et hold, som sætter vægt på et godt sammenarbejde.&lt;br /&gt; Jeg vil gerne høre mere fra jer hvis i er interesseret. I må gerne skrive en e-mail: erik.kiehl@hotmail.dk&lt;br /&gt;&lt;br /&gt;Der skal siges at jeg er fra Københavnsområdet og det ville være en kæmpe bonus, hvis man selv var fra Københavnsområdet. Da jeg senere hen, ville have det godt med at have muligheden for at mødes over en kop kaffe og snakke sammen med hele holdet.&lt;br /&gt;</description>
      <link>http://www.udvikleren.dk/forum/46525/team-hold-vedroerende-spiludvikling/</link>
      <pubDate>Sat, 04 Apr 2015 12:06:20 GMT</pubDate>
    </item>
    <item>
      <title>Unity3D - programmering i c# hvordan kommer jeg igang ?</title>
      <description>Hej&lt;br /&gt;&lt;br /&gt;Jeg har for noget tid siden installeret Unity og forsøgt at lære, at lave små scripts i c#, men det går bare ikke særligt godt, da jeg ikke føler at jeg har det fornødne fundament at stå på omkring forståelsen af c# - ja, jeg er vist en rigtig über c# noob !&lt;br /&gt;&lt;br /&gt;Jeg har set mange tutorials på YouTube og læst side op og side ned om c# scripting, men lige lidt hjælper det, da jeg ikke kan omsætte det jeg ser og læser til noget brugbart når jeg selv skal igang.&lt;br /&gt;&lt;br /&gt;Det er den ene side af problemet, den anden er, at når jeg så endelig kommer igang, så er jeg simpelthen hunderæd for, at lave en fejl, da de kompilerings fejlmeddelelser jeg uvægerligt får, ikke siger mig noget som helst ! - jeg har været rundt og kigge på nettet for, at se om jeg kunne finde ud af hvad fejlmeddelelserne betyder - sådan in plain english, men har ikke været særligt heldig.&lt;br /&gt;&lt;br /&gt;Så er der også lige problemet med at forstå eksemplerne i Unitys Scripting Reference, men dem synes jeg er skrevet så kryptisk, at jeg heller ikke rigtig forstår dem - det ville virkelig hjælpe hvis de havde en Scripting reference for Dummies. (at jeg ikke forstår dem skyldes selvfølgelig mit manglende fundament !)&lt;br /&gt;&lt;br /&gt;Det jeg dog forstår er:&lt;br /&gt;&lt;br /&gt;- Variabler: jeg ved at de holder på værdier og at disse kan manipuleres&lt;br /&gt;- if(){} statements: om noget er true eller false&lt;br /&gt;- for() løkker: tæller op (++) eller ned (--) og hopper ud af lykken når værdien true.&lt;br /&gt;&lt;br /&gt;Jeg har være rundt på nettet og søge efter kurser, men der er ikke rigtig noget, som omhandler Unity og C# scripting - ja, jeg har faktisk være så "desperat", at jeg også har kigget efter om det var muligt at hyre en privatlærer, som kunne lave et mini kursus, så jeg ligesom kan få "hul på bylden" !&lt;br /&gt;&lt;br /&gt;Så, hvad mener I ? - ska' jeg bare erkende, at C# ikke er for alle og nogle af os simpelthen er for dumme til at lære det eller skal jeg bare klø på og accepterer, at jeg oplever nederlag og frustration 98 gange ud af 100 når jeg prøver at kode i c# !&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
      <link>http://www.udvikleren.dk/forum/39977/unity3d-programmering-i-c%23-hvordan-kommer-jeg-igang-/</link>
      <pubDate>Wed, 29 May 2013 15:43:49 GMT</pubDate>
    </item>
    <item>
      <title>System.Random - range</title>
      <description>Hej, jeg er gået igang med lidt unity efter en meget lang C# pause.&lt;br /&gt;&lt;br /&gt;jeg ville lave sådan man spawner et random sted (ud fra de spwans der er placeret i mappet)&lt;br /&gt;&lt;br /&gt;jeg har prøvet med det her:&lt;br /&gt;&lt;div class="codeboxheader" id="code_635030900" onclick="ToggleCodeBox(this.id);"&gt;&lt;img id="code_635030900_arrow" src="/images/icons/codeboxarrow_down.gif" alt="Fold kodeboks ind/ud" title="Fold kodeboks ind/ud" /&gt;CSharp kode&amp;nbsp;&lt;/div&gt;&lt;pre id="code_635030900code" style="border-top: 0px; display: none;"&gt;&lt;ol&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn()&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;(spawned)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            Destroy(curentPlayer);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            spawned &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        System.Random rand &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Random();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        GameObject[] spawn &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; GameObject.FindGameObjectsWithTag(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;spawn&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawns &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn.Length;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;(spawns &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            ErrorManager.addError(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;No spawn points in this map&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; random &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; rand.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;, spawns&lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        GameObject randomSpawn &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn[random];&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        curentPlayer &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Instantiate(playerPrefab, randomSpawn.transform.position, Quaternion.identity);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        spawned &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;virker helt perfekt, men har lagt mærke til jeg ALDRIG spawner det ene sted.&lt;br /&gt;&lt;br /&gt;så prøvet det her stump kode for at se hvor random det faktisk var.&lt;br /&gt;&lt;br /&gt;&lt;div class="codeboxheader" id="code_772950964" onclick="ToggleCodeBox(this.id);"&gt;&lt;img id="code_772950964_arrow" src="/images/icons/codeboxarrow_down.gif" alt="Fold kodeboks ind/ud" title="Fold kodeboks ind/ud" /&gt;CSharp kode&amp;nbsp;&lt;/div&gt;&lt;pre id="code_772950964code" style="border-top: 0px; display: none;"&gt;&lt;ol&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; randTest()&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        System.Random rand &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Random();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] res &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;[&lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;];&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800080;"&gt;1000&lt;/span&gt;&lt;span style="color: #000000;"&gt;; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; r &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; rand.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            res[r]&lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;output&lt;br /&gt;&lt;div class="codeboxheader" id="code_1682834234" onclick="ToggleCodeBox(this.id);"&gt;&lt;img id="code_1682834234_arrow" src="/images/icons/codeboxarrow_down.gif" alt="Fold kodeboks ind/ud" title="Fold kodeboks ind/ud" /&gt;Kode&amp;nbsp;&lt;/div&gt;&lt;pre id="code_1682834234code" style="border-top: 0px; display: none;"&gt;
492
UnityEngine.Debug:Log(Object)
player:randTest() (at Assets/Scripts/player.cs:49)
player:Start() (at Assets/Scripts/player.cs:17)

508
UnityEngine.Debug:Log(Object)
player:randTest() (at Assets/Scripts/player.cs:50)
player:Start() (at Assets/Scripts/player.cs:17)

0
UnityEngine.Debug:Log(Object)
player:randTest() (at Assets/Scripts/player.cs:51)
player:Start() (at Assets/Scripts/player.cs:17)
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;så 3 forkommer aldrig, nogen bud på hvorfor?&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Next(Int32, Int32)	Returns a random number within a specified range.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.random.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.random.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;hele klassen er her:&lt;br /&gt;&lt;div class="codeboxheader" id="code_1951031280" onclick="ToggleCodeBox(this.id);"&gt;&lt;img id="code_1951031280_arrow" src="/images/icons/codeboxarrow_down.gif" alt="Fold kodeboks ind/ud" title="Fold kodeboks ind/ud" /&gt;CSharp kode&amp;nbsp;&lt;/div&gt;&lt;pre id="code_1951031280code" style="border-top: 0px; display: none;"&gt;&lt;ol&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #0000FF;"&gt;using&lt;/span&gt;&lt;span style="color: #000000;"&gt; UnityEngine;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;using&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Collections;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; player : MonoBehaviour &lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;{&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt;  GameObject playerPrefab;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; Object curentPlayer;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;bool&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawned &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Use this for initialization&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Start () &lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt;Spawn player&lt;/span&gt;&lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        spawn();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        randTest();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn()&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;(spawned)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            Destroy(curentPlayer);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            spawned &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;false&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        System.Random rand &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Random();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        GameObject[] spawn &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; GameObject.FindGameObjectsWithTag(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;spawn&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawns &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn.Length;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt;(spawns &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            ErrorManager.addError(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;No spawn points in the map&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; random &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; rand.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;, spawns&lt;/span&gt;&lt;span style="color: #000000;"&gt;-&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        GameObject randomSpawn &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; spawn[random];&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        curentPlayer &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Instantiate(playerPrefab, randomSpawn.transform.position, Quaternion.identity);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        spawned &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; randTest()&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        System.Random rand &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; System.Random();&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;[] res &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt;[&lt;/span&gt;&lt;span style="color: #800080;"&gt;3&lt;/span&gt;&lt;span style="color: #000000;"&gt;];&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;for&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800080;"&gt;1000&lt;/span&gt;&lt;span style="color: #000000;"&gt;; i&lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;int&lt;/span&gt;&lt;span style="color: #000000;"&gt; r &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; rand.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;            res[r]&lt;/span&gt;&lt;span style="color: #000000;"&gt;++&lt;/span&gt;&lt;span style="color: #000000;"&gt;;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;        Debug.Log(res[&lt;/span&gt;&lt;span style="color: #800080;"&gt;2&lt;/span&gt;&lt;span style="color: #000000;"&gt;]);&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/li&gt;&lt;li style="padding: 0; margin: 0;"&gt; &lt;span style="color: #000000;"&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;</description>
      <link>http://www.udvikleren.dk/forum/39644/system.random-range/</link>
      <pubDate>Thu, 28 Feb 2013 14:06:53 GMT</pubDate>
    </item>
    <item>
      <title>C#/mono client + PHP server: networking</title>
      <description>Hej alle sammen.&lt;br /&gt;&lt;br /&gt;Jeg er gået i gang med at lave et spil i Unity3D, og nu har jeg noget data jeg gerne vil have gemt i en sql server, sådan en bruger kan spille vidre fra en anden pc.&lt;br /&gt;&lt;br /&gt;nu tænker jeg så hvad er den smartest måde at undgå at brugeren kan ændre det data der sendes til serveren.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. hash&lt;/b&gt;&lt;br /&gt;har tænk lidt på at sende et hash af værdierne + et salt med, og se om det passer på serveren, inden dataen gemmes.&lt;br /&gt;&lt;div class="codeboxheader" id="code_1836220728" onclick="ToggleCodeBox(this.id);"&gt;&lt;img id="code_1836220728_arrow" src="/images/icons/codeboxarrow_down.gif" alt="Fold kodeboks ind/ud" title="Fold kodeboks ind/ud" /&gt;Kode&amp;nbsp;&lt;/div&gt;&lt;pre id="code_1836220728code" style="border-top: 0px; display: none;"&gt;
{
  data: [a, b, c, d],
  sum: ac1dddb66e84f423f421e1dfe1dc32235ce66de1
}
&amp;gt; http://192.168.0.250/data/save?data[0]=a&amp;data[1]=b&amp;data[2]=c&amp;data[3]=d&amp;sum=ac1dddb66e84f423f421e1dfe1dc32235ce66de1
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. kryptering&lt;/b&gt;&lt;br /&gt;er der en relativt nem måde at lave en sikker forbindelse mellem C# og PHP?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;det bedste er vel at lave 1 + 2 &lt;img src="/images/smileys/smiley.gif" alt=":)" title=":)" /&gt;</description>
      <link>http://www.udvikleren.dk/forum/38587/c%23-mono-client-+-php-server-networking/</link>
      <pubDate>Sun, 12 Aug 2012 13:10:20 GMT</pubDate>
    </item>
  </channel>
</rss>