Function signature doesnt match the parent error

Godot Version

ver4.3

Question

`I upgraded to godot 4.3 from 4.2 and facing several issues.
first, Im receiving two errors for my gravity function.
(1) “the function signature doesnt match the parent. Parent signature is "get_gravity()->Vector2
(2) “the method “get_gravity()” overrides a method from native class “PhysicsBody2D”. This wont be called by the engine and my not work as expected

func get_gravity() -> float:
	if is_on_zero_gravity:
		return 0.0
	return jump_gravity if velocity.y < 0.0 else fall_gravity

`

you probably should rename your method. get_gravity is a method inside of PhysicsBody2D and you are currently trying to override it.
Probably has been added with 4.3

1 Like

Ohhh Thank you so much! Problem solved !

Dont forget to mark this issue as solved :smiley:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.