Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 833 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 8 of 31 1 2 6 7 8 9 10 30 31
Re: Unity 3 announced [Re: Tman] #314782
03/10/10 22:44
03/10/10 22:44
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Originally Posted By: Tman
Unity is great I had an issue with it's state management system, which is seemingly going to get worked out. I might just switch back to complete my project.

Anyone wanna give a script example of a function from Unity that feels comfortable for a C-Script/Lite-C user? blush

For instance, how would I write things like camera looks at me, enemy follows me, state switches from attack to flee...

Re: Unity 3 announced [Re: Pappenheimer] #314783
03/10/10 22:45
03/10/10 22:45
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
yeah i would also like to see such example.(just to get an idea)


3333333333
Re: Unity 3 announced [Re: Pappenheimer] #314787
03/10/10 22:54
03/10/10 22:54
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Originally Posted By: Pappenheimer
Originally Posted By: Tman
Unity is great I had an issue with it's state management system, which is seemingly going to get worked out. I might just switch back to complete my project.

Anyone wanna give a script example of a function from Unity that feels comfortable for a C-Script/Lite-C user? blush

For instance, how would I write things like camera looks at me, enemy follows me, state switches from attack to flee...



Camera looks at me (all in C#):

Code:
public Transform playerPtr;


void Update()
{
  transform.LookAt(playerPtr); 
}



assign it to the camera in the editor, and drag n drop the player into the "playerPtr" field. done.

Enemy follows player is simliar:

Code:
public Transform playerPtr;


void Update()
{
  transform.LookAt(playerPtr); 
  transfor.Translate(Vector3.forward * 20); // Move enemy into his forward Vector
}



Apply to enemy, drag n drop player into the playerPtr field, done.


For statement switches, i actually always use ENUMS

Code:
private enum MoveStates
{
  ATTACK,
  FLEE,
  IDLE
}

private MoveStates moveState;

...

// If player comes too close, flee
if(Vector3.Distance(transform.position, playerPtr.position) < 1))
  moveState = MoveStates.FLEE;

...
void Update()
{
  switch(moveState)
  {
    case MoveStates.FLEE:
      transform.LookAt(playerPtr);
      transform.Translate(-Vector3.forward * 10);
      break;
  }
}




It would run away backwards, looking at the player, but just to get an idea how you would make it.

Is it that what you wanted to know?

EDIT:
i left out the class definitions and library includings, as this is genereated automatically when creating a script anyway and looks the same for almost any script anyway.

it is just a plain:

Code:
using UnityEngine;
using System.Collections;

public class scriptName : MonoBehaviour 
{
  void Start()
  {
  }

  void Update()
  {
  }
}



Last edited by Captain_Kiyaku; 03/10/10 22:58.

My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: Unity 3 announced [Re: Captain_Kiyaku] #314789
03/10/10 23:09
03/10/10 23:09
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Thanks a lot!
I still don't get the class things, but that's not your fault, your examples looks really easy compared to Lite-C.
Even me might have the chance to understand that.
Maybe, I get the chance to take a course in C# for a week in April.

Re: Unity 3 announced [Re: Pappenheimer] #314790
03/10/10 23:19
03/10/10 23:19
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Well the class thing isn't too relevant actually and you still could write in Javascript.

The class gets created for you by default when you create a script. You just have to make sure the class name is the equal to the files name.

And then you add all function into that class. There are default function like Start, Update, OnGUI, etc or you create your own ones (void foo(), int counter() ,etc).

You usually dont have multiple classes in one script file, so it doesn't really matter. Just see it as a border around your functions.


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: Unity 3 announced [Re: Captain_Kiyaku] #314791
03/10/10 23:25
03/10/10 23:25
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
@Kihaku, you have any suggestions where to start with unity?(like you start with lite-c workshops for gamestudio)

Know the concepts and patterns of object oriented programming and have some just a alittle above beginner c# experience, i also know javascript.


3333333333
Re: Unity 3 announced [Re: Quad] #314794
03/10/10 23:32
03/10/10 23:32
Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Captain_Kiyaku Offline

Dichotomic
Captain_Kiyaku  Offline

Dichotomic

Joined: Apr 2002
Posts: 4,801
Richmond B.C., Canada
Well i started with UnityScript which is basicly Javascript with some changes.
It is very easy to use and i think the only disadvantage is that you can't use the .NET features compared to C#.

So i basically used Javascript for few month, and then switched to C#. It's super easy to switch over to C# once you know all the stuff in Unity when scripting in UnityScript (JScript).


My Blog

"Tag und Nacht schrei ich mich heiser,
Wind weht alle Worte fort,
Tag und Nacht schrei ich mein Krähenwort!"

Subway To Sally - Krähenkönig
Re: Unity 3 announced [Re: Quad] #314795
03/10/10 23:37
03/10/10 23:37
Joined: Aug 2008
Posts: 6
K
Konrad Offline
Newbie
Konrad  Offline
Newbie
K

Joined: Aug 2008
Posts: 6

Re: Unity 3 announced [Re: Konrad] #314809
03/11/10 07:18
03/11/10 07:18
Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Machinery_Frank Offline
Senior Expert
Machinery_Frank  Offline
Senior Expert

Joined: Nov 2004
Posts: 7,121
Potsdam, Brandenburg, Germany
Thanks Kiyaku, this looks really easy and convenient.


Models, Textures and Games from Dexsoft
Re: Unity 3 announced [Re: Machinery_Frank] #314816
03/11/10 10:12
03/11/10 10:12
Joined: Dec 2003
Posts: 1,225
germany
gri Offline
Serious User
gri  Offline
Serious User

Joined: Dec 2003
Posts: 1,225
germany

hi,

I checked the feature list of the HOLY free unity3d indie version.

Looks nice, but for me Render_To_Texture is a must-have!
So it have to pay 880,- euro for this feature.

And there are no Realtime-shadows, no Fullscreen Postprocessing.
So I come to the following conclusion:

Unity PRO
is very nice no question and for the guys who have the money its a big improvement compared with Gamestudio.

Unity Indie
doesnt realy compete with A7 com because the lack of features I want to have and get with A7 com !

So I wish all unity Indie fans much fun playing around with the included nice looking WorldEditor and coding in "modern" language like C#.

But what can you realy reach with this castrated version?

Building the 10000000-st Iphone App , maybe a puzzle-game in 3D? -useless

So I stay with A7 comm.
Maybe its Editors looks outdated but I dont what to marry them( I have affairs with Blender already).
I only need the potency of the Engine.


This is like the cars of 2 individuals.

The one likes the nice looking shiny varnish of his car and triggers the buttons of the stereo. He gives a damn that his engine was limited to drive only on Highways ....he loves to observing the automatic-antenna .

The other one doesnt care about the hard working steering control his car have. The car got cleaned 10 years ago but hey(!) he can drive wherever he want.

And yes I agree unity Pro is like a Porsche possible to swim,dive and fly.


regards gri,


"Make a great game or kill it early" (Bruce Shelley, Ensemble Studios)
Page 8 of 31 1 2 6 7 8 9 10 30 31

Moderated by  aztec, Blink, HeelX 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1