Casting from float32 to Radian[float32] for assigning Node2D rotation property with Vector2 angle() #224
-
I'm learning Nim and trying to convert code from GDScript. Here's my current code:
When I build, I'm given an error: I've tried to force cast such as: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
There seems to be a deficiency in the gdext math library. I'll update it. Until then, please add the following after the import statement to work around it. import std/math
func angle*[T: SomeFloat](self: Vector[2, T]): T =
arctan2(self.y, self.x) |
Beta Was this translation helpful? Give feedback.
-
Thanks @panno8M for the support and update! |
Beta Was this translation helpful? Give feedback.
There seems to be a deficiency in the gdext math library. I'll update it. Until then, please add the following after the import statement to work around it.