TxC
September 29, 2024, 8:11am
1
To my knowledge this should just work.
extends Area2D
func _physics_process(_delta):
look_at(get_global_mouse_position())
func shoot():
const BULLET = preload("res://bullet.tscn")
var new_BULLET = BULLET.instantiate()
new_BULLET.global_position = %Shooting_Point.global_position
new_BULLET.global_rotation = %Shooting_Point.global_rotation
%Shooting_Point.add_child(new_BULLET)
func Fire():
if Input.is_action_pressed("Shoot"):
shoot()
1 Like
dbat
September 29, 2024, 9:06am
2
There is a bunch of missing info here. Maybe post the scene tree and also format your code with the </>
tool.
TxC
September 29, 2024, 3:54pm
3
Fixed the Problem by just adding a timer and attaching the if statement into the signal from that to regulate firerate which wouldve been the next step.
1 Like
system
Closed
October 29, 2024, 3:54pm
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.