The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

+1 vote

So i have the movement and everything but i have 3 Questions

  1. How do i remove moon-like gravity
  2. How Do i Make it so when i touch walls it doesnt Like, Lock the character there
  3. How Do i make it so my character doesnt slide when i release a key

Here's my code for reference

extends RigidBody2D

var Ray_Down
var Ray_Left
var Ray_Right
var Walkspeed = 80
var Runspeed = 20
var Jump = 150
var Player

func _ready():
    Ray_Down = get_node("RayCast2D")
    Ray_Left = get_node("RayCast2D2")
    Ray_Right = get_node("RayCast2D1")
    Player = self

func _process(delta):

    if Ray_Down.is_colliding():

    if Ray_Down.is_colliding():
        if Input.is_key_pressed(KEY_W):
            Player.set_axis_velocity(Vector2(0, -Jump))
    if !Ray_Right.is_colliding():
        if Input.is_key_pressed(KEY_D):
    if !Ray_Left.is_colliding():
        if Input.is_key_pressed(KEY_A):
in Engine by (483 points)

Um... what does "walls it doesn't like" mean?

1 Answer

+3 votes
Best answer

You can change the gravity in your project settings. Alternatively you can change the gravity scale of your node from the editor or from script.
To fix your wall problem you want to change the resistance of your RigidBody2D to something less than 1 (like 0.4)

by (63 points)
selected by

Thanks ^^ for the help

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.