Hello,
First thanks for your time reading.
what I want is;
Smoke out of the engine of the car via partycle system. When moving faster I want more smoke ( higher emission rate)
I tried:
using UnityEngine;
using System.Collections;
public class CarSound : MonoBehaviour {
public float topSpeed = 100; // km per hour
private float currentSpeed = 0;
public ParticleSystem.EmissionModule emission;
void Update () {
currentSpeed = transform.GetComponent <Rigidbody> ().velocity.magnitude * 3.6f;
emission = currentSpeed / topSpeed;
transform.GetComponent <ParticleSystem> ().emission = emission;
}
}
I cant test it because I get few errors:
Particle.emission cannot be assigned to ‘it is read only’.
I cant fix it my self. I am still a beginner and I don’t know that much!
Anyone with a solution ?
Kind regards,
Ranec