Hi,
I have a particle system attached to my player. I've been trying to get the particles to follow the player when they move...What I think I need to do is to get the position of the Particle Emitter component and then take the difference of the players position. I think that I am missing something because I see no trail (which is what I am expecting) in the general area of where the player moves too.
I want to acheive a similar effect like dragging the Particle Emitter arbitrailly in the world, --dragging would represent the player moving in this case.
I might add that the particles are instantiated before this code updates.
`if (Vector3.Distance(Player.lastPosition, Player.myPosition) > 0.01f) // we moved
{
Player.lastPosition = Player.myPosition; // Update our Positionif (Player.ParticlePrefab != null) {
// Get the difference of our two positions
Vector3 FollowTarget = Player.ParticlePrefab.GetComponent<ParticleEmitter>( ).transform.position - Player.myPosition; if (Vector3.Distance(FollowTarget, Player.myPosition) > 0.01f)
//We are already emitting…
{
Debug.Log(Player.PartriclePrefab.GetComponent( ).position);
}}
`
I think that it is right to get the ParticleEmitter component, but I am seeing a Transform component..Since my particles are already instantiated, wouldn't take up less memory to use the Transform component instead?