When i rotate a rigid body, its not affected by gravity

Godot Version

4.3

I made this script so my rigid body would rotate along with the player
@onready var player = get_node(“/root/Main/Player”)
func _process(delta: float) → void:
self.rotation_degrees.y = player.rotation_degrees.y + 90

and when I run it the rigid body 3d stops falling and gets stuck in place. I made a script to grab it but it wont move either, its just stuck in the middle of the air. Anyone got any clues to make it work?

Just to check, have you given your rigid body a PhysicsMaterial? It needs that in order to function properly.

Yup, I wasnt usin one at first but adding one didnt change it. I guess setting its rotation every frame is making it lag? i tried adjusting its rotation every time i move my mouse but its very laggy. If theres a better approach it would be awesome

Huh, that’s odd. I’m not quite sure what’s causing it.

Im pretty sure that because rigidbodys are affected by physics. Id recommend using a characterbody. That + it’s template you can generate when attaching a script makes it the best for making a character

1 Like

Yup, i don’t know why setting the rotation for a rigid body completely broke its velocity but but using a char body works fine. Thanks for the help!

1 Like

No problem, glad to be of use!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.