x


Particle following Emitter Problem

Hello there guys, I have a problem, I made a simple Candle particle system but when I move the emitter:

alt text

I just want it to move like a normal candle,you know just move a little for the air resistance. If someone know the solution please explain me how to do it or if you want more information :)

Problem Number 2:

I've attached the Camera an image effect, Depth of Field,so the distant background is blurred. So when the flame faces the blurred background... :

alt text

I want it to be just a Simple Flame like when it's infront of an unblurred background :)

Any help would be vary appreciated :) Thank you!

more ▼

asked Jul 27 '12 at 11:01 PM

unicornstudios gravatar image

unicornstudios
3 1 1 2

(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

answer 1

change 'Emitter velocity scale' to 0.5 - 1 to apply emitter's move speed to particles

answer 2

  • 'depth of field' effect is based on distance from camera to object. that distance is taken from z-buffer (also known as camera's depth texture).
  • transparent objects (and particles too) doesn't write to z-buffer it's distance

that's why flame is blurred. all you need is to draw flame AFTER applying blur effect. this can be achieved using second camera for flame only and render it after main camera.

also you can draw flame with z-write enabled, but this can make some strange effects at flame edges.

answer 3 (bonus)

answer 4 (extra bonus)

switch to 'simulate in world space' to off, attach this to emitter, and try to move in game mode.

using UnityEngine;
using System.Collections;

public class AirResistance : MonoBehaviour
{
	public Vector3 ConstantSpeed = Vector3.up;
	public float EmitterSpeedAffect = 1f;

	ParticleEmitter particleEmitter;
	Vector3 lastPosition;

	void Start() { particleEmitter = GetComponent<ParticleEmitter>(); }

	void Update()
	{
		Vector3 newPosition = transform.position;
		particleEmitter.localVelocity = ConstantSpeed - (newPosition - lastPosition) * EmitterSpeedAffect / Time.deltaTime;
		lastPosition = newPosition;
	}
}

more ▼

answered Jul 28 '12 at 06:23 PM

ScroodgeM gravatar image

ScroodgeM
7.6k 2 6

Hello,thanks for your answer,I fixed the blurred flame but I think you didn't get what's my problem for the 1st one. I didn't change the velocity to have that kind of flame as Picture 1 shows, that's a trail thingy it leaves when I move the candle. I think you get what I mean,It's should move only a bit when I move the flame,like a real flame,but instead when I move the flame (move the emitter) it leaves on hell of a particles after it following the emitter.

Jul 29 '12 at 12:12 AM unicornstudios

i think i understand your question. world speed exactly do what you want, after emitter is moved all already emitted particles are not moved.

PS i can't load picture 1 from question.

Jul 29 '12 at 05:26 AM ScroodgeM

Hello there,thank you for your time, but I don't seem to have a "World Speed" setting. Here is the Picture from Question one. http://i50.tinypic.com/ern78k.png And now see that I don't have the World Speed setting: http://screensnapr.com/v/o3Yddk.jpg Thanks for your time.

Jul 29 '12 at 01:35 PM unicornstudios

i'd edit answer

Jul 29 '12 at 05:27 PM ScroodgeM

Hello there,unfortunatelly it doesn't help,It doesn't change the trail that my emitter leaves...Are you sure you get what I need? I coul'd show you the problem online on Skype,thanks in advance.

Jul 31 '12 at 02:14 PM unicornstudios
(comments are locked)
10|3000 characters needed characters left

For your first problem, If you are using legacy particles, then just untick the box that says "Simulate in Worldspace" from the inspector.

I am unsure of how to fix this problem with the shuriken system(if it even occurs)

more ▼

answered Jul 31 '12 at 03:01 PM

Akill gravatar image

Akill
121 3 4 6

Hello there,yes I've tried that,but now it's just a still flame,it looks so unrealistic,we want it to move,but only a bit.

Aug 01 '12 at 11:41 AM unicornstudios

I don't understand, just change the settings of your particle system to animate the particles and make it "move"

Aug 01 '12 at 12:11 PM Akill

But the problems is, I want when I move the Candle,the flame to follow like a normal flame. For example, light a candle and move it around,it's not gonna leave long trails behind it like mine. That's the thing I am trying to achieve.

Aug 01 '12 at 05:28 PM unicornstudios
(comments are locked)
10|3000 characters needed characters left

Have you tried making your particle emitter create a very large number of particles per second with a very short lifespan (0.1 seconds)? Then your candle will still have some substance to it, but the tail can't possibly get too long, because the particles don't survive very long.

You'll probably need to give the particles some kind of default force as well to make sure that the particles actually travel some distance in their short amount of time.

As for the blurring problem, you could always render your character's arm and candle with a different camera than the one that renders the scene.

more ▼

answered Aug 01 '12 at 07:18 PM

Screenhog gravatar image

Screenhog
1.5k 5 10 19

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x460
x318
x151
x89
x77

asked: Jul 27 '12 at 11:01 PM

Seen: 673 times

Last Updated: Aug 01 '12 at 07:20 PM