Example for sequential code:
Console.WriteLine("Hello");
Sleep(20);
Console.WriteLine("End");
Example for loop code(function is being looped):
bool step2 = false;
bool step3 = false;
bool beginn = true;
int i = 0;
void looped() //each second
{
if (beginn == true)
{
Console.WriteLine("Hello");
beginn = false;
step2 = true;
}
if (step2 == true)
{
if (i <= 20)
{
i++;
}
else
{
step2 = false;
step3 = true;
}
}
if (step3 == true)
{
Console.WriteLine("End");
step3 = false;
}
}
Which program converts sequential code into loop code? I want to use it for unity, so c#/mono or javascript output is desired.
In general, what are the right terms for each kind of coding?
PS:
My actual code looks like(sequential version)
//licht = light GameObject
//kontrolle = WASD-control
//spieler = Player GameObject
//target = Vector3
//fallenb = Vector3
//fallenr = Vector3
var smooth = 2.0;
licht.light.intensity = 1;
kontrolle.enabled = false;
spieler.GetComponent("MouseLook").enabled = false;
spieler.GetComponent("CharacterMotor").enabled = false;
spieler.GetComponent("FPSInputController").enabled = false;
while(spieler.position != target)
{
spieler.position = Vector3.MoveTowards(spieler.position, target, smooth);
}
while (spieler.position != fallenb spieler.eulerAngles != fallenr)
{
spieler.position = Vector3.MoveTowards(spieler.position, fallenb, smooth);
spieler.eulerAngles = Vector3.Slerp(spieler.eulerAngles, fallenr, Time.deltaTime * smooth);
}
Which does not work.
The program is called “human developer”. Hard to get one of those though. 
Honestly, I doubt there is such a program. But more doubts on whether you should actually use something like that - simply because any kind of loop should be seen as a basic technique in programming.
I guess your code is not that hard to get fixed, though I am not sure if that code sample is enough to tell.
Just a shot in the dark: Are you calling that code from somewhere inside a function, like Update() or any other function?
if you stick your code inside the Update function and change the while loop to an if statement, it schould work. Update gets called once per frame so it is a loop already. With your code you basically say: that at one frame we are at our start position and in the next we are at our target position
In that case it would be helpful if you could post the whole code. Yet as element_wsc already says: You will need to use a yield statement in your code if you want it to be executed over several frames - and it seems like that actually.
Here’s Unity’s reference on coroutines and yield statements:
http://docs.unity3d.com/Documentation/ScriptReference/index.Coroutines_26_Yield.html
Hier
private var enter = false;
var playerName = "Untagged";
var licht : GameObject;
private var los = false;
private var bewegen = false;
private var drehen = false;
private var blende = false;
private var fall = false;
private var isDead = false;
private var target : Vector3;
private var zieldrehung : Vector3;
private var fallenb : Vector3;
private var fallenr : Vector3;
var spieler : Transform;
var kontrolle : CharacterController;
var smooth = 2.0;
function Start(){
target = new Vector3 (-1.161601,0.9177396,-0.2097381);
zieldrehung = new Vector3 (0,0,0);
fallenb = new Vector3 (-1.418318,0.3112697,0.4207797);
fallenr = new Vector3 (90,0,0);
}
function Update (){
if (los)
{
licht.light.intensity = 1;
kontrolle.enabled = false;
spieler.GetComponent("MouseLook").enabled = false;
spieler.GetComponent("CharacterMotor").enabled = false;
spieler.GetComponent("FPSInputController").enabled = false;
if(spieler.position != target)
{
spieler.position = Vector3.MoveTowards(spieler.position, target, smooth);
}
if (spieler.position != fallenb spieler.eulerAngles != fallenr)
{
spieler.position = Vector3.MoveTowards(spieler.position, fallenb, smooth);
spieler.eulerAngles = Vector3.Slerp(spieler.eulerAngles, fallenr, Time.deltaTime * smooth);
}
blende = true;
}
if(Input.GetKeyDown("h") enter){
los = true;
}
}
var style : GUIStyle;
function OnGUI(){
if(enter){
GUI.Label(new Rect(Screen.width/2 - 100, Screen.height - 100, 200, 30), "Press h to measure your height");
}
}
function OnTriggerEnter (other : Collider){
if (other.gameObject.tag == playerName) {
enter = true;
}
}
function OnTriggerExit (other : Collider){
if (other.gameObject.tag == playerName) {
enter = false;
}
}
Just a general tip first:
It’s a good practice to keep your code in English as this makes it more readable to other people, since the common expectation is to get English. It works in most other languages as well, no question, but for people whose mother tongue is not German (in this case) will need to jump back and forth to keep the variable names in mind and see what they do.
And especially once it comes to commented code you may not get any help at all because it’s just unreadable.
The same also applies to the language in an international board. 
About your code:
In my eyes it’s a bit too complex and does not really care about any performance (GetComponent() should mostly be used in Start()) but it should still work.
Before I try to jump too deep into that, where exactly are you stuck? What happens if you put some Debug.Log() statements in the several functions? Are they executed and shown as supposed, or are some statements left out? Do you have rigidbodies attached, and are your triggers really triggers, or still used as colliders?