I'm trying to make it so you can pick up an object with your mouse. But the object also obays gravity.
I've put in this:
on (press) {
startDrag("");
}
on (release) {
stopDrag();
}
onClipEvent (load) {
var grav:Number = 0;
}
onClipEvent (enterFrame) {
grav++;
_y += grav;
while (_root.ground.hitTest(_x, _y, true)) {
_y--;
grav = 0;
}
}
I can pick the object up, and it obays gravity, however, when I pick it up it still falls to the ground. How do I make it so when I've picked it up, it won't fall to the ground?