- Home /
Particle system won't stick to player after shoot
Hye, I'm still new in unity, so I hope to learn more in this community. I currently have a problem. I want to make my player attack or shoot using particle system but failed. I'm using this code ParticleSystem b = Instantiate(bullet, transform.position, Quaternion.identity); to make the particle system stick to the player. It does stick, but, the particle system won't move towards X position, and I currently using 2 particle system for the attack, so, when i use that code, it makes the particle system split. When I remove the code, it moves perfectly fine but, the particle system won't stick to the player. I'm stuck in this problem. Sorry for the inconveniences. ,Hello, I'm still new in unity so I hope to learn more from the community. I have a problem where I want to make player attack or shoot using particle system. I actually use the code ParticleSystem b = Instantiate(bullet, transform.position, Quaternion.identity); to make it stick to player. It does stick but, it wont move to the front and I currently using 2 particle system for the attack movement, but it split after I use this code. If I remove this code, It move perfectly fine but, the particle system wont stick to the player. I currently stuck in this problem.
below is the code I used to make it shoot after player press keycode Q:
if(Input.GetKeyDown(KeyCode.Q)) { if (isAttacking) return;
anim.SetTrigger("isAttack");
isAttacking = true;
Invoke("ResetShoot", ShootDelay);
//Instantiate and shoot bullet
PlayBullet();
ParticleSystem b = Instantiate(bullet, transform.position, Quaternion.identity);
b.GetComponent<Rigidbody2D>().velocity = new Vector2(3, 0);
},