Hey!
First of all, thank you dearly for opening up this question.
I'm trying to recreate pong and make it two player. It's for this reason that I decided to create one script - playerScript.gd - that handles the physics for both player1.gd and player2.gd, and then having different movement mappings between player 1 and 2.
I think the easiest way to show my problem is by adding the code.
~~~~
playerScript.gd
extends KinematicBody2D
class_name player
export var speed = 300
#func _process(delta):
# pass
This is the script that I will eventually use to handle the collision detection for both players.
~~~~
player1.gd
extends player
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
func _process(delta):
var mov = Vector2()
if Input.is_action_pressed("p1_up"):
mov.y -= 1
if Input.is_action_pressed("p1_down"):
mov.y += 1
mov = mov.normalized() * speed
move_and_slide(mov)
moveandslide(mov) is highlighted RED with this error:
Line 7 (UNUSED_ARGUMENT):The argument 'delta' is never used in the function '_process'.
~~~~
Do I need to multiply something by the delta? I found that when I don't call the classname player, replace it with KinematicBody2D and include the speed variable in the player1.gd script, everything works fine and I'm able to move the player up and down.
The issue is this doesn't work when I try to call an external script.
What am I missing?