Godot Version
` 4.4
Question
` it is on line 7
extends Area2D
var CharacterBody2D
func _on_CharacterBody2D_eneter_underworld():
change_CharacterBody2D_pos(, 100, 300)
` 4.4
` it is on line 7
extends Area2D
var CharacterBody2D
func _on_CharacterBody2D_eneter_underworld():
change_CharacterBody2D_pos(, 100, 300)
(, 100, 300)
There’s one too many coma in there.
when I remove the first coma it says. Line 3:The member “CharacterBody2D” shadows a native class.
Line 7:Function “change_CharacterBody2D_pos()” not found in base self.
Is that how this is spelled? “eneter”?
Also I seem to have misread the code you posted.
What does that function do? :
Honestly this is a mess to read.
You’re using “CharacterBody2D” as a variable name when it’s also a class… I’m lost here.
It may be better to post in-detail, what is the big picture thing you are trying to do. I fear there is no way to make your script work as it currently is, because there is huge gaps in what you are trying to do versus what is given to the computer (change_CharacterBody2D_pos
does not exist), and clear signs you may be new to Godot (var CharacterBody2D
).
Instead asking help for the general idea means we may actually be able to solve your issue, building a greater understanding for your knowledge of how to use the engine, and in what situations. The syntax issues are only a very small part of a larger machine.
You asked virtually the same question a few hours ago.
I don’t intend to come across as snide or mean, but you currently lack sufficient knowledge of GDScript and Godot to understand any of the answers people are giving you. Your interpreter (the thing in Godot that turns your code into instructions the computer understands) is currently trying to tell you the following things:
CharacterBody2D
. But I already know of something else in the code that goes by that name, so you have to pick a different name for your variable.”change_CharacterBody2D_pos
, but I don’t know of any function by that name.”(I have taken the liberty of translating the error messages to plain English.)
These are very basic errors. Any halfway decent introduction to GDScript will cover subjects like how to declare variables somewhere around lesson #1, and declaring functions tends to be lesson #2 or thereabout. If you follow and complete the Dodge the Creeps introduction project, those subjects will be covered. In fact, that project alone will teach you about 80-90% of everything you absolutely need to know. I can only recommend again you complete it first before asking the same question a third time.