10 was attempting to apply .forward that way, I fixed that.
If applies random amount of y axis force (up down in this game) to vary the trajectory.
I have finally narrowed down the issue. The coins are colliding with each other as they spawn.
setting is kinematic has yielded nothing.
As it stands, it works more or less, but it is FAR FAR from what I really need it to do, which is a simple fanning out.

this is my current standing code. The spawn point has no rigidbody, the actual treasurepot and coins do(it is essential)
#pragma strict
var coinsToSpawn : int = 1;
var gren : GameObject;
var Projectile : GameObject;
var health : int;
var smacked : int = 0;
var pot : Rigidbody;
var Spawn : Transform;
var Spawned : int;
var bonusCoins : int = 1;
function Start () {
//this.rigidbody.AddTorque(0,0,2.5);
}
function Update () {
}
function OnCollisionEnter(hitInfo : Collision)
{
if(hitInfo.gameObject.tag == "Player")
{
//pot.isKinematic = true;
//if(smacked < 1)
//{
//smacked ++;
health = PlayerScores.health;
if(health < 1000)
{
if(smacked < 1)
{
smacked = 1;
coinsToSpawn = bonusCoins + (hitInfo.rigidbody.velocity.magnitude / 2.25) ;
Spawned = coinsToSpawn;
}
spawnCoins();
}
if(health >= 1000)
{
if(smacked < 1)
{
smacked = 1;
coinsToSpawn = bonusCoins + (hitInfo.rigidbody.velocity.magnitude * 2.25);
Spawned = coinsToSpawn;
}
spawnCoins();
}
}
}
//}
function spawnCoins()
{
//for(var i :int = 0;i < coinsToSpawn ;i++)
//{
for(var icount : int = 0; icount < coinsToSpawn;icount ++)
{
//Spawn.transform.eulerAngles = Vector3(0,0,Random.Range(-180,180));
gren = Instantiate(Projectile,Spawn.position,transform.rotation);
gren.transform.position.z = 100;
//gren.rigidbody.isKinematic = true;
//gren.rigidbody.transform.eulerAngles = Vector3(0,0,Random.Range(-360,360));
gren.rigidbody.rotation.z = (-180/coinsToSpawn) * icount;
gren.rigidbody.transform.forward = Vector3(Random.Range(0,8),Random.Range(0,8),0);
yield WaitForSeconds(0.1);
Spawned--;
//j = 0;
}
//WaitForFixedUpdate();
//gren.rigidbody.isKinematic = false;
// }
if(Spawned < 1)
{
Destroy(gameObject);
}
}
I can currently get everything I need out of this, except for the fanning of projectiles. I have gone back and forth with the code. The commented code represents what I did that yielded no results at all, the current code at least scatters them around a bit.
I’m lost, and got so turned around with this one…any help would be awesome. As you can see, I’ve muddled with a number of things, but ultimately until I get some advice I have moved on to other code, where I haven’t confused myself so badly… This doesn’t even seem like it should be very complicated to me. I code harder stuff, so why is this killing me, I don’t know.
Please help.