• Creating particles at a dynamic position
    5 replies, posted
Currently, I am creating a ParticleEmitter, then setting the position on the fly to make it emit particles when the user does an action. This position constantly changes based on the user. The two issues I have is one, it only displays clientside, and two, it is really inefficient with setting the ParticleEmitter every frame. Is there a way I can emit particles for every user at a changing position? Also, I realise I can network the position of the emitter to every player and make them set the position of their own clientside ParticleEmitter, but this causes an issue when two people create particles at the same time.
Dont know much about particles but could you just create them serverside and parent them?
[QUOTE=rtm516;50461470]Dont know much about particles but could you just create them serverside and parent them?[/QUOTE] You can't create them serverside.
[QUOTE=code_gs;50461417]The two issues I have is one, it only displays clientside[/QUOTE] Surprise: All rendering operations are preformed clientside. [QUOTE=code_gs;50461417]and two, it is really inefficient with setting the ParticleEmitter every frame. [/QUOTE] Then don't. The position of the particle emitter ( Assuming we talk Lua emitters, not OB ones ) is only used for particle ordering. And then again you can set it only before you are emitting the particles, which you are not emitting every frame. [QUOTE=code_gs;50461417]Is there a way I can emit particles for every user at a changing position? [/QUOTE] You already achieved this? [QUOTE=code_gs;50461417]Also, I realise I can network the position of the emitter to every player and make them set the position of their own clientside ParticleEmitter, but this causes an issue when two people create particles at the same time.[/QUOTE] What issue?
[QUOTE=Robotboy655;50461608]Surprise: All rendering operations are preformed clientside.[/quote] I'm aware, I'm just saying you have to network it to all players. [QUOTE=Robotboy655;50461608]Then don't. The position of the particle emitter ( Assuming we talk Lua emitters, not OB ones ) is only used for particle ordering. And then again you can set it only before you are emitting the particles, which you are not emitting every frame.[/quote] I set it every time a particle is emitted, which is about every 0.1 seconds. [QUOTE=Robotboy655;50461608]You already achieved this?[/quote] Not really; see issue below. [QUOTE=Robotboy655;50461608]What issue?[/QUOTE] If two players in another player's PVS emit particles at the same time, their clientside particle emitter can't be in two places at the same time.
[QUOTE=code_gs;50461628]If two players in another player's PVS emit particles at the same time, their clientside particle emitter can't be in two places at the same time.[/QUOTE] The chance of someone "inputting a particle emit" at the same tick is very low. Even if they did, it is a limitation of your networking then. As I said, you don't really have to set the actual position of the particle [b]emitter[/b], the [b]only[/b] difference it has on the particles emitted from that emitter is which particles would be drawn above which. EVEN THEN, you technically should be able to set the position of the emitter twice in a frame, it won't affect the position of the particles emitted.
Sorry, you need to Log In to post a reply to this thread.