x


Shuriken particle system useWorldSpace?

Hi, I'm working on a game where you can cast a spell that makes a trail of poison on the ground. The poison trail consists of shuriken particles systems from Unity 3.5. There are some horizontal bilboards in those systems and the problem is, the systems need to be able to travel uphill on a terrain. So the angle of the particles should change according to the hill angle, to keep them facing away from the terrain and preventing them to be just horizontal and go half through the terrain. When it comes to coding I have everything to make this work, I use raycasting to get the exact angle of the hill and the prefab rotates exactly the way I want it to.

Problem: when I rotate the prefab, it doesn't do much because it contains horizontal bilboards, that of course don't rotate because they are forced to be horizontal. Now I found out, by using a plane mesh and the rendermode Mesh for the particle system, I can rotate them as I want, but only in the editor. Once the system is emitting in the game, for some reason rotating the prefab doesn't effect the rotation of the planes anymore. UNLESS I set it to be local space. But then I have the problem the particles travel as 1 pack and don't stick to the ground, because you need them to be worldspace for this..

I think the solution lies in alternating between localSpace and worldSpace but, unlike normal particle emitters, the ParticleSystem class doesn't have a variable to set the simulation space? Does anyone know how to change the simulation space of a shuriken particle system in code?

Thanks :)

more ▼

asked Feb 23 '12 at 02:01 PM

Yoerick gravatar image

Yoerick
729 2 5 14

Does anyone know?

Feb 27 '12 at 01:16 PM Yoerick

I solved my specific problem with a workaround but I'd still like to know if it's possible at all to switch a shuriken particle system's simulation space between world and local space? (in code)

Mar 14 '12 at 03:57 PM Yoerick
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Lock to Transform checkbox.

on = local space off = world space

more ▼

answered Mar 01 '12 at 02:32 AM

mighty_marcos gravatar image

mighty_marcos
1

Oops, missed the last line in your question's never mind

Mar 01 '12 at 08:58 PM mighty_marcos
(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:

x164
x107
x32

asked: Feb 23 '12 at 02:01 PM

Seen: 2084 times

Last Updated: Mar 14 '12 at 04:16 PM