0 votes

Right now I got the particles to move inwards,
but it is starting at the center and moving outwards first.

I only want it to move inwards, but to do that I need to make it start away from the center.

Is there a way I can do this?

The node type is CPUParticles2D.

Godot version v3.4
in Engine by (15 points)

2 Answers

0 votes

This can likely be done by using a positive Linear Velocity and a negative Linear Acceleration in the CPUParticles2D node. Over the particle's lifetime, the negative acceleration will make the particle slow down then reverse. If the lifetime is long enough, the particle will be going inward at the end of its lifetime.

The same can also be achieved with GPU-based particles and 3D particle nodes.

by (11,917 points)

I don't see Linear Velocity. I filtered properties that have "velocity" in them and I only see Initial/Angular/Orbit velocity. Did you mean Initial Velocity? I tried making the initial velocity positive and linear acceleration negative but it didn't work.

0 votes

You can choose emission shape in particle material. Choosing anything other than point will make particles randomly spawn within this shape. Now You can convert particle material to shader material, find the piece of code connected to emission_shape uniform ( it is near the top ) and rewrite mathematical formula, so particles will only be spawned on the edges of shape. Be aware, that shader code for emission shape will not exist in shader if You don't choose emission shape before converting particle material into shader material.

by (5,557 points)

I have set emission shape to sphere, and made a new Shader Material for the particle, but I don't see the code which I need to edit. When I make the shader material, the 'Shader' property (which seems to be the script file) is empty. Do I need to make a Shader script file?

No no, You are supposed to create new particle material like normally, next choose emission shape to sphere, and then go back to material options and choose "convert to shader material". This option appears after creating particle material. It will give You access to shader code behind particle material.

I changed emission shape back to point,
and then under 'Materials' tab, I created a 'NewCanvasItemMaterial'.
Then changed emission shape to sphere, and converted the material to 'ShaderMaterial'.

Did I do it correctly?
I see there is a script attached this time, but when I open it there are only two lines of code, which are

shadertype canvasitem;
rendermode blendmix;

I don't see 'emission shape uniform'. Did I go wrong somewhere?

there are 3 types of materials : canvas, spatial and particle. All of them are shader materials with code hidden from the user. Yet every material can be converted into shader material with script. Here we just want to convert particle material into shader material
When You use Particles node, You have to choose particle material. Only this material has all these options like emission shape and starting velocity, gravity. So only change emission shape to sphere, and convert it whole into shader material. No canvas material inbetween. You will see a large shader script attached

So you mean I should make a 'New ParticleMaterial' in the Material tab of the particle node? I don't have that option... I only get 'New CanvasItemMaterial' and 'New ShaderMaterial'. Am I looking in the wrong place?
Screenshot: https://imgur.com/a/FBU3bbi

Particles2D and Particles3D node don't have material property, they have Process Material. There You have only 2 options to choose from - particle material and shader material. And at this point I realised You are working with CPUParticles haha :P
But what is the point ? can't You use normal particles ? ;)

It's not the case for me.... https://imgur.com/a/Ld16Qix

I see it has process materials as well though
I'll try it right now

I made sure that I created a NewParticlesMaterial, set emission shape to sphere and converted it into ShaderMaterial. But I can't find code related to emission_shape... https://imgur.com/a/h1DAPcV

images don't load :(
Did You menage to get access to huge shader script ? Ctrl + F to find which part of code is connected to uniform emissionshaperadius, You will easily find mathematical formula with sinuses and cosinuses near the upper part of the code

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.