playMaker

Author Topic: Particle System SetProperty not happening on android device [SOLVED]  (Read 1536 times)

Rupe

  • Playmaker Newbie
  • *
  • Posts: 7
I am trying to control the settings of a ParticleSystem from an FSM using SetProperty. It is working fine in the Editor but nothing seems to be happening on my android device. Does anyone have any ideas.

Some specifics:

I have a ParticleSystem on my prefab which has a simple particle system. It is set to "Play On Awake" but the emission module is disabled. Sometime after creating an instance of the prefab, my FSM is using GetComponent to grab the ParticleSystem, then setting its enableEmission property to true, to turn the system on (while also using startColor, emissionRate, etc to configure its behaviour).

As I said, the above is working fine in the editor, but on my device nothing is happening.

If I enable the emission module in the prefab then the particle system does play on the device as expected, as soon as the instance is created. But I can't change its properties (colour etc).

I would far prefer to do things using SetProperty like this (rather than adding any extensions to PlayMaker), in order to keep my project size down and because I'm not looking to do anything more complex than what ought to be possible using Set/GetProperty.
« Last Edit: April 10, 2017, 09:31:04 AM by Rupe »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Particle System SetProperty not happening on android device
« Reply #1 on: April 10, 2017, 06:33:48 AM »
Hi,

 You need to use the Linker Wizard for this. http://hutonggames.com/playmakerforum/index.php?topic=11126.0

The few addition of actions has  negligible impact on your project really, I would recommend if you know how to write actions to do them, Get Property/set Property is really good when you can't script at all, as soon you do, please create actions.
 
Bye,

 Jean

Rupe

  • Playmaker Newbie
  • *
  • Posts: 7
Re: Particle System SetProperty not happening on android device
« Reply #2 on: April 10, 2017, 09:03:29 AM »
Thanks very much for the information, that all makes sense to me now and everything is working fine.

Although I am an experienced coder, the aim of the project I'm working on is to make it possible for other people to create asset-bundled content using PlayMaker, so rather than try to anticipate what they'll be wanting to do, it feels preferable to simply make ParticleSystem functionality available to them through the Get/SetProperty actions they're familiar with. 

I can see how the linker wizard would be useful for someone unsure of what they need to put in their link.xml, but in case anyone else has the same issue that I did and comes across this thread, it may be be helpful for them to know that my fix (which appears to have made all those get/set actions work ok with ParticleSystems) was just to put this simple link.xml file in my Assets folder....

<linker>
  <assembly fullname="UnityEngine">
    <type fullname="UnityEngine.ParticleSystem" preserve="all" />
  </assembly>
</linker>
« Last Edit: April 10, 2017, 09:20:41 AM by Rupe »