I'm new to godot and I was trying to make a asteriods type game. But i'm having trouble getting my space ship to shoot.
The issue is that I can't get the bullet to fire in direction of the ship. I set an 'angle' variable in the ship and assign it to the bullet once it has been instanced, but i'm not sure how to use it in the bullet. The bullet will just move right no matter the angle of the ship.
Ship Firing Code:
var Bullet_Instance = Bullet.instance()
Bullet_Instance.angle = angle
var angle = 0
var direction = Vector2(cos(angle), sin(angle))
I'm pretty sure that the angle variable is being reset to 0 in the bullet code after it has been set in the ship code, but i'm not sure how to fix this. Thanks.