I have a game object with a particle effect that uses rate over distance for emissions.
What I want to do is: when the user touches, the particles will transform to the new position (without making a trail) and start a new trail as the user drags. Each new touch starts new particles.
But that’s not what happens. What keeps happening is when the user starts the touch, the particles draw a line from the previous touch spot to the new touch spot, every time.
I’ve tried everything under the sun to get this to work properly. I’ve tried:
- turning off the emissions and then turning them on at the start of the new touch (still made a trail).
- instantiating a new game object with particles at the new touch point (still made a trail).
- adding a rigid body with kinematics (you know).
Is this possible???
Don’t think it matters, but here’s some code on how I transformed the particles to a new position:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class particleEffect : MonoBehaviour {
Touch touch2;
bool effectIson;
void Update () {
if (Input.touchCount > 0)
{
touch2 = Input.GetTouch(0);
//turn on effect
effectIson = true;
}
//if efect is on
if (effectIson)
{
transform.position = Camera.main.ScreenToWorldPoint(touch2.position);
}
}
}