|
Post by pixelknight on Mar 31, 2016 6:50:47 GMT
Hi all,
I've got a 3rd person 3d game I'm working on and just started using coregamekit for my pooling and waves, I'm very new to this but have watched all the tutorials although they don't really talk through any of the scripting aspects so perhaps I'm just using the wrong thing here.
But I have this code
if (PoolBoss.PoolItemInfoByName ("Projectile") == null) Debug.Log ("NO REFENCE to Projectile prefab found in pool"); else { Debug.Log ("Spawning projectile at position " + transform.position.x + "," + transform.position.y + "," + transform.position.z);
PoolBoss.Spawn ("Projectile", transform.position, projectileRotation, transform); }
Now the projectile spawns fine and I can see it being taken form the pool and appears in the right position, however, what I find is that when I then move my player, the projectiles I already spawned also move, as if their position is still tied to the player position? I've no script in the projectile yet, it's just a simple prefab, with cube, which has a box collider and rigidbody. I've set gravity on/off to no avail and I Lock the Y position on it .
Is it something really simple I"m doing wrong here?
|
|
|
Post by pixelknight on Mar 31, 2016 7:18:47 GMT
Ahh I just spotted PoolBoss.SpawnOutsidePool, that works fine 
|
|
|
Post by DarkTonic Dev on Mar 31, 2016 15:50:51 GMT
Indeed. No need to use Spawn usually, just use SpawnOutsidePool and SpawnInPool.
You also could use Spawn and pass NULL as the last parameter, meaning to give it no parent (which is what SpawnOutsidePool does).
|
|