0 votes

how would you do a gravity system that works like this; https://www.youtube.com/watch?v=QLH_0T_xv3I

(gravity changes based on what area your player's kinimaticbody is)

Godot version 3.2.3
in Engine by (15 points)

1 Answer

0 votes

You can use Areas for that. Both Area2D and Area3D have properties to alter the gravity of nodes inside them. See space_override and the various gravity_... properties they have.

Alternatively, you could manually detect when the player enters the Area using their body_entered signal, and implement a custom gravity that way.

by (2,478 points)

Here's an article from the official documentation on how to use an Area2D to modify gravity. The properties can also be applied to an Area node (with some modification, of course).

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 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 webmaster@godotengine.org with your username.