I have a prefab Shuriken Particle system & I want it to follow a rock after it collides.
2.I can't gett it to follow the rock the this script is attached to only be created where it collides. I think I need an update function but I don't know how to fit that in below.
Thanks for any help.
var Debris : GameObject;
When "Debris" is your prefab, you might want to save the actual instantiated object which is returned by the "Instantiate" function. You can then access it's components like transform or the particle system.
Something along this, perhaps.
answered Apr 27 '12 at 06:19 PM
Sorry guys this is really hard for me to get my head around as I'm an artist not a coder. So try to make it as simple as poss. Thanks for the help!
So I have a prefab called Debris & an animated Rock you saying to put the script on the prefab instead of the rock to access the the components of it?
I tried this but got an error.... Assets/Scripts/Prefab Scripts/Rock_Debris.js(1,45): BCE0005: Unknown identifier: 'Rock_Particle_Debris'.
var actualObject : GameObject = Instantiate(Rock_Particle_Debris, transform.position, transform.rotation); // Wait... actualObject.transform.postion.x += 10; // move it actualObject.transform.particleEmitter.enabled = false;; // stop the emitter