I couldn't find a specific section dedicated to Unity or Game Engines in general, so I assume this was the best section for this. If not, I'm sorry!
I've recently been starting to learn Unity, however, I haven't been able to figure out how to create Game Objects with a script with C# in unity.
What I've tried so far is creating an empty game object, then attaching my script and rigid body physics to that object.
//C# GameObject bulletClone = Instantiate(projectile, transform.position, transform.rotation) as GameObject;
But that doesn't work. I found a tutorial with how to do it with Javascript (not ideal but would be sufficient), however, once I create the objects they go spinning into oblivion.
//In Javascript
var thePrefab : GameObject;
function Start () {
for (i=0;i<=10;i++) {
var instance : GameObject = Instantiate(thePrefab, transform.position, transform.rotation);
instance.transform.position.x += 10;
}
}
If anyone has any ideas, or any extra information to help me out, I'd appreciate it. Thanks.

New Topic/Question
Reply




MultiQuote




|