Need help with collisions / lights

Godot Version

v4.3.stable.steam [77dcf97d8]

I’m working on a game for a game jam and I’m trying to make the player which is a light to collect cubes to keep the light going before it fades out over time.

I’m having trouble when the player collides with the cube the light gets bigger and the cube disappears doesn’t.

Here are the scripts I have so far.

extends OmniLight3D

func _on_timer_timeout():
	omni_range -= 0.10
extends Area3D

@onready var omni_light_3d: OmniLight3D = $CollisionShape3D/OmniLight3D

func _on_area_entered(area):
	omni_light_3d.omni_range += 1
	queue_free()

I’m just getting back into Godot. What am I doing wrong here?

Does the timeout ever get called? Is there an error in the debug window?

You might need to add extra print statement to track exactly what’s happening.

I kind of fixed it. I had to rewrite the player as an Area3D instead of CharacterBody3D.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.