Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

399
Visualizações
(unity)Is there a way to set the position of every particle in a particle system?

So i want to make like an aura around the player, like in warcraft 3 or path of exile, etc, using a particle system, and when the character is idle it works perfectly fine. Thing is when it isnt idle.

I've tried changing the particle system position itself using Update(), but that doesnt really affect the position of the particles. What i need is to set each one of them to the players position.

Is there a way to set the particles to the position of the player?(or any position at all)

Thanks

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

To answer your problem

You can change the ParticleSystem.simulationSpace

Controls whether particles are animated in the parent object’s local space (therefore moving with the parent object), in the world space, or relative to a custom object (moving with a custom object of your choosing).

to ParticleSystemSimulationSpace.Local

Simulate particles in local space

Either via the Inspector of the Main Module

enter image description here

or via code like

GetComponent<ParticleSystem>().main.simulationSpace = ParticleSystemSimulationSpace.Local;

To answer your question title

Yes. You can get the particles via ParticleSystem.GetParticles, change their ParticleSystem.Particle.position and then write them back into the system using ParticleSystem.SetParticles

var particles = new ParticleSystem.Particle[theParticleSystem.main.maxParticles];
var currentAmount = theParticleSystem.GetParticles(particles)

// Change only the particles that are alive
for (int i = 0; i < currentAmount; i++)
{
    particles[i].position = XYZ;
}

// Apply the particle changes to the Particle System
theParticleSystem.SetParticles(particles, currentAmount);
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda