Unity 2018.2.9f1, only 1 script, there is no other code. The scene is very simple (I just started).
I'm working on a mobile game and I'm trying to play a particle effect at the tap location.
I managed to get the particle effect to play, but when I attempt to change transform.position the particle no longer displays at all. I see the TapEffect's GameObject X and Y coordinates being updated in the Editor, but the actual animation is not playing.
This is the script I have attached to my player, the particle is the only child of Player at the moment.
public class Player : MonoBehaviour {
private ParticleSystem tapEffectParticle;
private Vector2 touchPos;
void Start () {
this.tapEffectParticle = transform.GetChild(0).GetComponent<ParticleSystem>();
}
void Update () {
if(Input.touchCount > 0) {
Touch touch = Input.GetTouch(0);
if(touch.phase == TouchPhase.Began) {
touchPos = touch.position;
tapEffectParticle.transform.position = touchPos;
tapEffectParticle.Play();
}
}
}
}
Here is a screenshot of the TapEffect Particle, default particle.
This is a view of the Player GameObject selected.


Text. NOTE: I removed the text code from the script (2 lines of code) just to simplify it since it has nothing to do with the problem. \$\endgroup\$