Stick a rigidbody to another
Asked Answered
H

6

0

how would i stick a rigidbody to another? im trying to make a magnet which makes things stick to it but i cant figure out how. Thanks!

Habanera answered 20/10, 2023 at 17:59 Comment(0)
H
0

There are a number of classes derived from Joint3D you can look into:

There are probably tutorials out there on using some of these, but I haven't watched any yet.

Harl answered 20/10, 2023 at 22:22 Comment(0)
O
0

I am using joint in my current game, look at this discussion I had when I figure this out : https://mcmap.net/q/225/godot-how-to-make-this-body

Openeyed answered 20/10, 2023 at 23:58 Comment(0)
H
0

Harl

Im using a pinjoint2d in 4.2b right now, but it is still quite buggy and unpredictable. sad there isnt a fixedjoint2d. is there a way to attach it to 2 pinjoints at the same time to stick it down?

Habanera answered 21/10, 2023 at 19:9 Comment(0)
H
0

Habanera

If you're up for it, you might be interested in this Box2D plugin for Godot. It adds a Weld Joint which might do what you need.

Another option is to use _integrate_forces and code the magnetic behavior yourself.

Harl answered 22/10, 2023 at 1:53 Comment(0)
H
0

Harl Ill look into it! Just hope it doesnt mess up my gravity / player movement 😃

Habanera answered 22/10, 2023 at 8:19 Comment(0)
H
0

Harl didnt work unfortunately it broke when the magnet touched anything and i could not find a weld joint

Habanera answered 22/10, 2023 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.