#godot problem or bug ?

8 messages · Page 1 of 1 (latest)

pseudo tangle
#

the actual problem is

-------------------------works------------------------------------------------------------
func _input(event):
    if event is InputEventMouseMotion:
        rotate_y(deg_to_rad(-event.relative.x * mouse_sens))
        head.rotate_x(deg_to_rad(-event.relative.y * mouse_sens)) 
        head.rotation.x = clamp(head.rotation.x,deg_to_rad(-89),deg_to_rad(89))    
    

# Add the gravity.
func _physics_process(delta):
    if not is_on_floor():
        velocity.y -= gravity * delta    
-----------------------------------------------------------------------------------------
---------------------does not work------------------------------------------------------
# Add the gravity.
func _physics_process(delta):
    if not is_on_floor():
        velocity.y -= gravity * delta    


func _input(event):
    if event is InputEventMouseMotion:
        rotate_y(deg_to_rad(-event.relative.x * mouse_sens))
        head.rotate_x(deg_to_rad(-event.relative.y * mouse_sens)) 
        head.rotation.x = clamp(head.rotation.x,deg_to_rad(-89),deg_to_rad(89))
--------------------------------------------------------------------------------------
#

TLDT
----not working----
gravity
head movement

---working---
head movement
gravity

pseudo tangle
#

I am only falling when im moving my head

#

If you are wondering where I got the code

pseudo tangle
#

Kelp me