Fix seed not randomizing for particles. Fix seed being stored when fixed seed is off
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user