Godot Version
v4.2.2.stable.official
Question
Hi Community,
I am working on a 3D game that is using many Sprite 3D nodes.
I’ve encountered an issue where a ‘Pow’ ‘particle’ effect, which is a Sprite3D node (billboard disabled), moves with the camera instead of staying fixed in the world space. The camera is attached to the player and the Sprite3D node is set to default properties.
Below is the code snippet for the ‘Pow’-Sprite:
@onready var PowText: Sprite3D = $PowText
func _ready() -> void:
var final_scale = randf_range(0.8,0.9)
var random_rotation = randi_range(-180, 180)
var random_disappear_time:float = randf_range(0.12, 0.22)
global_rotation_degrees = Vector3(0,0,random_rotation)
PowText.rotation_degrees.z = -global_rotation_degrees.z
transparency = 1.0
scale = Vector3.ONE * 0.5
var tween = get_tree().create_tween()
tween.tween_property(self, "scale", final_scale*Vector3.ONE, 0.08)
tween.tween_property(self, "transparency", 0, 0.08)
await tween.finished
var tween2 = get_tree().create_tween()
tween2.tween_property(self, "scale", 0.3*Vector3.ONE, random_disappear_time)
tween2.tween_property(self, "transparency", 1.0, random_disappear_time)
await tween2.finished
queue_free()
Could anyone advise on how to ensure the ‘Pow’ particle remains in place regardless of camera movement?
If I can provide more needed information, please let me know!