Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | merpis |
I’m a complete noob and have been following this tutorial - https://www.youtube.com/watch?v=WEt2JHEe-do&t=4078s and I would differ from the tut and add a mechanic where the enemies get larger as time progresses to make it harder. But, sense I’m a noob, I don’t know how to do that. I did try this though:
extends RigidBody2D
export var min_speed = 150.0
export var max_speed = 250.0
var size = $AnimatedSprite.scale(2, 2)
var size_collision = $Collision.scale(2,2)
func _ready():
$AnimatedSprite.playing = true
var mob_types = $AnimatedSprite.frames.get_animation_names()
$AnimatedSprite.animation = mob_types[randi() % mob_types.size()]
func _on_VisibilityNotifier2D_screen_exited() → void:
queue_free()
func _on_SizeTimer_timeout() → void:
size += 1
size_collision += 1
and it no work error message was: attempt to call function ‘scale’ in base ‘null instance’ on a null instance