Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criptic error that doesnt help:" Assertion failed: Put a bullet scene first and it must be a BULLET Node" #2

Open
AndrejPatak opened this issue Jan 15, 2024 · 0 comments

Comments

@AndrejPatak
Copy link

AndrejPatak commented Jan 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant