Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | WeebyPerson |
I have just shifted from Godot 2d to 3d but I am unable to make nice movements.
I am using this code for my Rigidbody -
extends RigidBody
var jumpPower = 10
func _physics_process(delta):
if Input.is_action_pressed("ui_left"):
set_linear_velocity(Vector3(-1,0,0))
if Input.is_action_pressed("ui_right"):
set_linear_velocity(Vector3(1,0,0))
if Input.is_action_just_pressed("ui_up"):
set_linear_velocity(Vector3(0,jumpPower,0))
when the body is on ground it works fine
but when I move the body after it jumps and is in air it is flying and when i again leave the arrow keys only after that gravity effects it.