#(SOLVED) Dragging an object issue
16 messages · Page 1 of 1 (latest)
how would i make it so an object that can be clicked and dragged can only follow along a specific path?
the item in question is a gear shift if that helps to understand the issue
right now i have an object that is able to be clicked and dragged on a grid but it can go anywhere on screen
how do i confine it to a strict path
im thinking this could maybe be done with a path2d but im not exactly sure how
heres the code for my drag and drop object
puts a ward
This node could be useful: https://docs.godotengine.org/en/stable/classes/class_groovejoint2d.html#class-groovejoint2d
Inherits: Joint2D< Node2D< CanvasItem< Node< Object A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. Description: A physics joint that restricts the movement of...
Hmm, but that doesn't take care of the different gear grooves. For a simple game I might just make the gear path out of collision polygons, and stick some areas in the notches that detect entry and change gears or whatever it is.
ooo interesting idea, ill try something like that, thank you!
idk if theres a way to close a thread but
issue resolved
I think that you can here:
what most people do is just change the name to (solved) so others can read it in case they had the same issue
ohhh oky cool thank u