Can you please tell why this doesn't work? G: <br />Note: I named a Static Body2D as 'Area2D'.<br />
extends KinematicBody2D<br /><br />const gravity = 200.0<br />const speed = 200<br />const WALK_SPEED = 200<br />var velocity = Vector2()<br /><br />func
ready():<br /> set_fixed_process(true)<br /> get_node(&quot;../Area2D&quot;).connect(&quot;body_enter&quot;,self,&quot;on_Area2D_body_enter&quot;)<br /> get_node(&quot;../Area2D&quot;).connect(&quot;body_exit&quot;,self,&quot;
on_Area2D_body_exit&quot;)<br /><br />func fixed_process(delta):<br /><br />&nbsp; &nbsp; velocity.y += delta
gravity<br /><br />&nbsp; &nbsp; if (Input.is_action_pressed(&quot;ui_left&quot;)):<br />&nbsp; &nbsp; &nbsp; &nbsp; velocity.x = - WALK_SPEED<br />&nbsp; &nbsp; elif (Input.is_action_pressed(&quot;ui_right&quot;)):<br />&nbsp; &nbsp; &nbsp; &nbsp; velocity.x =&nbsp; WALK_SPEED<br />&nbsp; &nbsp; else:<br />&nbsp; &nbsp; &nbsp; &nbsp; velocity.x = 0<br /><br /> if is_colliding(Area2D):<br /> if (Input_is_action_pressed(&quot;ui_up&quot;)):<br /> velocity.y = -200<br /> <br /><br />&nbsp; &nbsp; var motion = velocity delta<br />&nbsp; &nbsp; motion = move(motion)<br /><br />&nbsp; &nbsp; if (is_colliding()):<br />&nbsp; &nbsp; &nbsp; &nbsp; var n = get_collision_normal()<br />&nbsp; &nbsp; &nbsp; &nbsp; motion = n.slide(motion)<br />&nbsp; &nbsp; &nbsp; &nbsp; velocity = n.slide(velocity)<br />&nbsp; &nbsp; &nbsp; &nbsp; move(motion)<br /><br /><br /> <br /><br />func
on_Area2D_body_enter( body ):<br /> print(&quot;Entered Area2D with body &quot;, body)<br />func on_Area2D_body_exit( body ):<br /> print(&quot;Exited Area2D with body &quot;, body)<br /> <br />