- Home /
DragObject Damping
I found this script on the Unity wiki, DragObject, and it works like a charm - in fact its exactly what I was looking for. However, I would like to have the ability to, when moving the object, the object moves at either a constant speed or dampens to the position. Right now I can click and drag and move my mouse rapidly and it follows it at the same pace.
Any suggestions on how to implement damping and/or constant speed to this?
Answer by kromenak · Aug 10, 2011 at 12:23 AM
Maybe I'm misunderstanding, but it appears that the script you are using already has that functionality - if you change the "moveLimit" variable, it should cap the movement speed of whatever you are dragging to some value, even if the mouse is moved very suddenly/quickly in a particular direction.
If it follows your mouse at the same pace now, then the default value of 0.5 might be too high. Try out some smaller values for this and see if you get the behavior you are looking for.
Answer by gregmax17 · Aug 10, 2011 at 12:35 AM
By gosh, you are absolutely right... how the hell did miss that variable?!
Is there a way to delete this?
Your answer
Follow this Question
Related Questions
Dragging movement Speed 1 Answer
Destroy object if collision is strong enouf 1 Answer
How do I lock a certain Axis on a drag object script? 0 Answers