Class GpuParticlesAttractor3D
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Particle attractors can be used to attract particles towards the attractor's origin, or to push them away from the attractor's origin.
Particle attractors work in real-time and can be moved, rotated and scaled during gameplay. Unlike collision shapes, non-uniform scaling of attractors is also supported.
Attractors can be temporarily disabled by hiding them, or by setting their Strength to 0.0
.
Note: Particle attractors only affect GpuParticles3D, not CpuParticles3D.
[GodotClassName("GPUParticlesAttractor3D")]
public class GpuParticlesAttractor3D : VisualInstance3D, IDisposable
- Inheritance
-
GpuParticlesAttractor3D
- Implements
- Derived
- Inherited Members
Properties
Attenuation
The particle attractor's attenuation. Higher values result in more gradual pushing of particles as they come closer to the attractor's origin. Zero or negative values will cause particles to be pushed very fast as soon as the touch the attractor's edges.
public float Attenuation { get; set; }
Property Value
CullMask
The particle rendering layers (Layers) that will be affected by the attractor. By default, all particles are affected by an attractor.
After configuring particle nodes accordingly, specific layers can be unchecked to prevent certain particles from being affected by attractors. For example, this can be used if you're using an attractor as part of a spell effect but don't want the attractor to affect unrelated weather particles at the same position.
Particle attraction can also be disabled on a per-process material basis by setting AttractorInteractionEnabled on the GpuParticles3D node.
public uint CullMask { get; set; }
Property Value
Directionality
Adjusts how directional the attractor is. At 0.0
, the attractor is not directional at all: it will attract particles towards its center. At 1.0
, the attractor is fully directional: particles will always be pushed towards local -Z (or +Z if Strength is negative).
Note: If Directionality is greater than 0.0
, the direction in which particles are pushed can be changed by rotating the GpuParticlesAttractor3D node.
public float Directionality { get; set; }
Property Value
Strength
Adjusts the strength of the attractor. If Strength is negative, particles will be pushed in the opposite direction. Particles will be pushed away from the attractor's origin if Directionality is 0.0
, or towards local +Z if Directionality is greater than 0.0
.
public float Strength { get; set; }
Property Value
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.