Scaling with Vector3.ONE

Godot Version

4.3

Question

Am I using the scaling correctly? I am following a guide to pop a bubble as the size increases. The guide says to use Vector3.ONE but when I use the script, I do not get the intended size increase when I click the object. I will paste my output as well as the guides instructions / output.

My Output:
extends Area3D

var clicks_to_pop : int = 3
var size_increase : float = 0.2
var score_to_give : int = 1

func _on_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
scale += Vector3.ONE * size_increase

Guides instructions / output:
We will now build upon this to increase the scale of the Balloon and detect if it is big enough to pop, instead of just printing a message to the screen. The first step will then be to increase the scale, to do this we will use this line of code:

func _on_input_event(camera, event, position, normal, shape_idx):
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
scale += Vector3.ONE * size_increase
In this case, we use Vector3.ONE to increase the scale uniformly across all axes. Vector3.ONE is essentially a normal vector, with 1 in every axis (1, 1, 1), so when we multiply it by our size_increase value, we change the 1s to the value of the size_increase variable. If you now save and press Play you will see that if you click the Balloon it will increase in size each time.

If you want to want to scale the area of your Area3D it is intended to scale the shape of the CollisionShape3D node. (Scaling PhysicsObjects is not intended to my knowledge and might brake your collision detection)
If you use your script on a MeshInstance3D node it should work.

This would be one way to increase the scale of your shape if it was a SphereShape3D to scale your CollisionShape3D’s shape:

extends Area3D

var size_increase : float = 1.0

func _input(event):
	if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
		((get_child(0) as CollisionShape3D).shape as SphereShape3D).radius += size_increase

(Assuming your Area3D node has a CollisionShape3D node as its first child)
This should work as well (changing the scale of the CollisionShape3D node:

extends Area3D

var size_increase : float = 1.0

func _input(event):
	if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
		get_child(0).scale += Vector3.ONE * size_increase

I notice you are extending an Area3D, your visual element must be a child of this script/node for the scale to also affect it. Could you show us the scene tree?

It is okay to scale Areas uniformly, your guide mentions this is why Vector3.ONE is chosen.