Fix clam spurt origin artifact (#118)
This commit is contained in:
parent
f910e6bdbb
commit
ae802493a0
2 changed files with 42 additions and 4 deletions
|
|
@ -29,12 +29,16 @@ func configure(
|
|||
entity_id = configured_entity_id
|
||||
data = configured_data
|
||||
type_id = data.type_id if data != null else StringName()
|
||||
# Establish the authoritative transform before constructing transient visuals.
|
||||
# Effects emitted before this point would begin at the default world origin.
|
||||
apply_network_state(position, yaw, true)
|
||||
if data != null and data.is_stationary_hotspot():
|
||||
_ensure_water_spurt_visual()
|
||||
_water_spurt_elapsed = (
|
||||
float(abs(hash(entity_id)) % 1000) / 1000.0
|
||||
* WATER_SPURT_INTERVAL_SECONDS
|
||||
)
|
||||
_emit_water_spurt()
|
||||
else:
|
||||
_ensure_visual()
|
||||
if data != null and data.catch_data != null and _sprite != null:
|
||||
|
|
@ -50,7 +54,6 @@ func configure(
|
|||
)
|
||||
)
|
||||
_sprite.rotation_degrees.x = data.sprite_tilt_degrees
|
||||
apply_network_state(position, yaw, true)
|
||||
|
||||
|
||||
func apply_network_state(
|
||||
|
|
@ -147,7 +150,6 @@ func _ensure_water_spurt_visual() -> void:
|
|||
hole.mesh = hole_mesh
|
||||
hole.cast_shadow = GeometryInstance3D.SHADOW_CASTING_SETTING_OFF
|
||||
_water_spurt_root.add_child(hole)
|
||||
_emit_water_spurt()
|
||||
|
||||
|
||||
func _emit_water_spurt() -> void:
|
||||
|
|
@ -159,6 +161,7 @@ func _emit_water_spurt() -> void:
|
|||
particles.amount = 6
|
||||
particles.lifetime = 0.42
|
||||
particles.one_shot = true
|
||||
particles.local_coords = true
|
||||
particles.explosiveness = 1.0
|
||||
particles.direction = Vector3.UP
|
||||
particles.spread = 32.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue