You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So im trying to make a gun that shoots a bullet. I made a scene with just the bullet node as required, then i made a gun node in another scene and passed in the scene of the bullet for the bullet parameter. Upon trying to call the Gun.shoot() function from my player node, the console gave me this error that tells me nothing useful. I looked in the code of the gun node and it still didnt make sense. What do i need to change? Heres my players script:
extends Sprite2D
var Gun = load("res://Fire Bullets/scripts/Gun.gd").new()
#Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
#Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_pressed("MouseLeft"):
Gun.shoot(2,0)
I have no clue why it is not working, i cant see anything in the docs that would help me, nor is there anything from the community that would help me
The text was updated successfully, but these errors were encountered:
So im trying to make a gun that shoots a bullet. I made a scene with just the bullet node as required, then i made a gun node in another scene and passed in the scene of the bullet for the bullet parameter. Upon trying to call the Gun.shoot() function from my player node, the console gave me this error that tells me nothing useful. I looked in the code of the gun node and it still didnt make sense. What do i need to change? Heres my players script:
I have no clue why it is not working, i cant see anything in the docs that would help me, nor is there anything from the community that would help me
The text was updated successfully, but these errors were encountered: