Fix seed not randomizing for particles. Fix seed being stored when fixed seed is off

This commit is contained in:
Qbieshay
2025-02-04 11:51:17 +01:00
parent 1586c5674b
commit 2f3f6f69d9
4 changed files with 16 additions and 6 deletions

View File

@@ -612,7 +612,7 @@ void CPUParticles3D::_validate_property(PropertyInfo &p_property) const {
}
if (p_property.name == "seed" && !use_fixed_seed) {
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
p_property.usage = PROPERTY_USAGE_NONE;
}
}
@@ -1564,6 +1564,8 @@ void CPUParticles3D::_bind_methods() {
BIND_ENUM_CONSTANT(DRAW_ORDER_LIFETIME);
BIND_ENUM_CONSTANT(DRAW_ORDER_VIEW_DEPTH);
ADD_PROPERTY_DEFAULT("seed", 0);
////////////////////////////////
ClassDB::bind_method(D_METHOD("set_direction", "direction"), &CPUParticles3D::set_direction);
@@ -1764,6 +1766,7 @@ CPUParticles3D::CPUParticles3D() {
set_emitting(true);
set_amount(8);
set_seed(Math::rand());
rng.instantiate();