I have this code that handles the spawning of an instantiated particle system whenever my bullet object hits something (game is 2D)
Debug.Log("Bullet collided with background and was destroyed"); Destroy(this.gameObject); GameObject clone = (GameObject)Instantiate(hitEffectYellow, transform.position, transform.rotation); Destroy(clone, 1f);
I’d like to be able to change the Y position of the instantiated object because at the moment it spawns at the start of the bullet trail instead of at the tip of the bullet. I have tried some ways to do it but after some research none of them even made sense to try in the first place, so i’m asking you guys here to help me figure out how to do this.
I think it’s something really simple but i’ve searched around and haven’t been able to find anything that worked yet. Just for clarification, i’d like the instantiated object to keep spawning at the position of the bullet object, but modifying the Y coordinate so it spawns further “up”.
Any help would be appreciated!