Godot Version
Godot v4.5.1
Question
Hello All,
I’m pretty new to game development in general, so I’m still learning the ropes.
I’m trying to create a fishing game, and the plan is for the fish to look similar to animal crossing, where it’s sort of just a dark circle with a tail. I wanted to create this using a circle with a particle emitter attached, emitting the same sprite but reducing in size over it’s lifetime via a curve.
I also have a difficulty system in mind, and I want the fish to vary in size based on another curve where most fish will be small with occasional larger ones, increasing as time goes on.
The problem I am having is how these two interact. Because the particle system curve is built into the process material, I think it is overwriting the scaling entirely. My spawn code looks like this, activating on a repeating timer timeout. The enemy.scale is working on the Node2D, but not the tail (particle effect) so I added the tail.scale line and I’m still having trouble.
func spawn_fish():
#Get Fish Node(s)
var enemy = preload("res://Fish/Fish.tscn").instantiate()
var tail = enemy.get_node("Tail") as GPUParticles2D
#Set Spawn Position
%SpawnPath.progress_ratio = randf()
enemy.global_position = %SpawnPath.global_position
#Modify Size
var difficulty: float = 1.0 + (Global.difficulty * .15)
var sample = randf()
var size = SizeCurve.sample(sample)
var final_size = Vector2.ONE * difficulty * size
#Create enemy and set size
add_child(enemy)
tail.scale = final_size
enemy.scale = final_size
The visual result is a bunch of fish shapes that are all the same size and at a lower framerate because the framerate is essentially the emission rate of the particle system. Any advice?