01-18-2014 09:56 AM
01-18-2014 07:09 PM
01-20-2014 02:30 PM
02-07-2014 07:21 PM
"owenwp" wrote:
The best thing to do would probably by to modify the particle instances directly using Get/SetParticles. You can add any camera roll delta to the rotation each frame.
02-10-2014 10:24 PM
02-11-2014 04:04 PM
02-16-2014 12:09 PM
02-28-2014 11:13 AM
09-30-2014 08:12 AM
10-03-2014 04:37 PM
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (ParticleSystem))]
public class ParticleViewRollCorrection: MonoBehaviour
{
private float lastRotation = 0f;
private ParticleSystem.Particle[] particles = new ParticleSystem.Particle[1000];
void LateUpdate()
{
if (!Camera.main)
return;
float currentRotation = Camera.main.transform.rotation.eulerAngles.z;
if (lastRotation == currentRotation)
return;
float rotationDifference = currentRotation - lastRotation;
int num = particleSystem.GetParticles(particles);
for (int i=0; i<num; i++)
particles[i].rotation += rotationDifference;
particleSystem.SetParticles(particles, num);
//particleSystem.startRotation += rotationDifference * Mathf.Deg2Rad;
lastRotation = currentRotation;
}
}