Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Oh, I got it. Do you use constant force or it depends on distance?

Actually looking back, what I'm doing is multiplying the normalized difference between the mouse position and the plug position by a constant and setting that to the plugs linear velocity in _physics_process. I honestly just messed around with a bunch of random approaches until I found a compromise between least buggy and sorta functional. I found it pretty hard to get the rigid bodies to behave correctly, it was a lot of trial and error.

I know it's hard with physics. Have you tried setting the dragged body to kinematic mode temporary? Just an idea from the top of my head

(1 edit)

Yep I did try that, but I'm a bit confused about how that's supposed to work in code because it's not like changing the body mode all of the sudden gives you access to the normal kinematic body methods like move_and_slide...  There's definitely a better solution then what I landed on, who knows if I'll ever get to implementing it though haha.

You don't neew move_and_slide, it's fine to adjust position directly (as you don't have much colliders around) to the mouse pointer position. Just saying

(+1)

I appreciate the back and forth, maybe I'll have to release a directors cut :D