You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.
I dont know could I ask for help there ,I'm using Godot 4.2 with Box2D 0.9.11, the sword moves by rotating, which usually works fine, but sometimes it slides forward as if it has no friction. Could some give me some direction on how to solve this problem?
the sword is rigidbody with a collision polygon2D
the polygon2D:
the code :
`var torque = 15
func _physics_process(delta):
var mouse_pos = get_global_mouse_position()
var dir_to_mouse = (mouse_pos - position).normalized()
var target_angle = atan2(dir_to_mouse.y, dir_to_mouse.x)
var delta_angle = wrapf(target_angle - rotation, -PI, PI)
var angular_speed = delta_angle * torque
angular_velocity = angular_speed`
I would be very grateful even if someone just gave me a hint.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Clipchamp.mp4
I dont know could I ask for help there ,I'm using Godot 4.2 with Box2D 0.9.11, the sword moves by rotating, which usually works fine, but sometimes it slides forward as if it has no friction. Could some give me some direction on how to solve this problem?
the sword is rigidbody with a collision polygon2D
the polygon2D:
the code :
`var torque = 15
func _physics_process(delta):
var mouse_pos = get_global_mouse_position()
var dir_to_mouse = (mouse_pos - position).normalized()
var target_angle = atan2(dir_to_mouse.y, dir_to_mouse.x)
I would be very grateful even if someone just gave me a hint.
The text was updated successfully, but these errors were encountered: