You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# main.gdextendsNodevarmy_node: Node=preload("res://a.gd").new()
func_process(delta: float) ->void:
my_node._process(delta) # Cannot call virtual function "_process()" because it hasn't been defined.
Steps to reproduce
Create a script (a.gd) based on Node that declares _process();
adamscott
changed the title
Cannot call virtual function because it hasn't been defined.
[Beta 3][GDScript] Cannot call virtual function because it hasn't been defined.
Jun 21, 2023
adamscott
changed the title
[Beta 3][GDScript] Cannot call virtual function because it hasn't been defined.
[4.1 Beta 3][GDScript] Cannot call virtual function because it hasn't been defined.
Jun 21, 2023
adamscott
changed the title
[4.1 Beta 3][GDScript] Cannot call virtual function because it hasn't been defined.
[4.1.beta3][GDScript] Cannot call virtual function because it hasn't been defined.
Jun 21, 2023
I think this might mean we need to partially revert #77324, without any replacement 😞
The issue is that at compile-time we cannot check whether any Object, Node or otherwise, has a script attached. The script is the one responsible for implementing virtual functions, so the base type is simply not enough. I'll have a PR ready momentarily.
Godot version
4.1.beta3
System information
Fedora Workstation 38 - Godot 4.1.beta3 - Vulkan (Forward+)
Issue description
This is an issue created by the production team, we're working on it
Currently, it's impossible to call virtual functions within GDScript.
This currently returns an error:
Steps to reproduce
a.gd
) based onNode
that declares_process()
;a.gd
instance;_process()
on that node;Minimal reproduction project
virtual_functions.zip (updated)
The text was updated successfully, but these errors were encountered: