#How to override existing function?

3 messages · Page 1 of 1 (latest)

calm pasture
#
# websocketClient.gd
class_name WebsocketClient
extends Node

func send(message) -> int:
#   Long code
    return OK

Error: Parser Error: The function signature doesn't match the parent. Parent signature is "int send(Variant)".

# client.gd
class_name Client
extends WebsocketClient

func send(command: String, data: Dictionary) -> int:
    return super.send({ command = command, data = data })
small fable
#

the function signatures must match, meaning that the amount of arguments and their types must be the same

calm pasture
#

hmmm,.