I'm trying to make a top down shooter in Godot but I'm stuck ! I've made two scenes first bullet and second player. And we can change the rotation and direction of the bullet accordingly to the direction of the player. But I can't access the direction variable from player because we can't extend / inherit more than one class / script.
#Bullet script
extends KinematicBody2D
var direction = "down"
func physics_process(delta):
#Something which can access the direction variable from player script.
#Player script
extends KinematicBody2D
var direction = "down"
func _physics_process(delta):
if Input.is_action_pressed("ui_left"):
direction = "left"
# And so on...
Pleas help me !