Godot Version
extends Node2d
func _on_area_2d_body_entered(body)
if (body.name == “CharacterBody2D”)
body.velocity.y = -300
Question
Hi.
I am new to Godot and for basic training I’ve decided to create a Geometry Dash clone.
I’ve almost done everything except the JUMP ORBS.
can someone help me?
At the moment the orb script is just the basic jump pad script.
I think you should just do on_body_entered and then you access the player and make the velocity.y value of the player equal the jump_velocity
extends Node2d
var touching_player := false
const JUMP_VEL := -300
func _on_area_2d_body_entered(body)
if (body.name == “CharacterBody2D”)
touching_player = true
func _on_area_2d_body_exited(body)
if (body.name == “CharacterBody2D”)
touching_player = false
func _process(_delta : float):
if touching_player and Input.isActionJustPressed("Jump"):
body.velocity.y = JUMP_VEL