Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | hamoom |
Does Godot allow you to extend base classes?
can I write code for something like
Vector2.random_angle()
Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | hamoom |
Does Godot allow you to extend base classes?
can I write code for something like
Vector2.random_angle()
Reply From: | kidscancode |
No, you can’t extend a base class.
An option: you could define some static functions in a singleton.
static func vector_random_angle(vector):
return vector.rotated(rand_range(0, 2*PI))