Godot Version
v4.3.stable.arch_linux
Question
I’m making a simple platformer game in which the main mechanic is a “Van” (StaticBody) that acts as a “moving platform” that starts moving automatically when the player climbs over the roof (Like “The Dolphin The Dolphin” from Dadish 3)
func _physics_process(delta: float) -> void:
match Current_state
States.MOVING:
print("VAN MOVING")
global_position.x += SPEED * delta
func _on_player_detector_body_entered(body: Node2D) -> void:
Current_state = States.MOVING
My problem is that when the van starts moving, the player doesn’t move with it, so it slides through the roof of the van like this:
Is there any way to fix my issue, thanks in advance
PD: Sorry for my bad English, I apologize for any misspelt word or confusing sentence, and also, if you need more information, feel free to ask