rem Drag an Object
sync on : sync rate 60
rem Make floor
make object plain 1,300,300
position object 1,0,-50,0
xrotate object 1,270
rem Make object to drag
make object cube 2,100
set shadow shading on 2
rem Setup camera and light
set point light 0,-100,500,-100
position camera -200,0,-200
point camera 0,0,0
global x#,y#,z#,d#
global dx#,dy#,dz#
global obpx#,obpy#,obpz#
global pickmode
global object
do
MouseDrag2(2)
sync
loop
end
remstart
Do
If Shiftkey() = 1 and ObjectNumber > 0
If Object Exist(ObjectNumber) = 1
MouseDrag2(ObjectNumber)
Endif
Endif
Loop
remend
//Use the mouse to position the object
Function MouseDrag2(Object)
//Needed more accuracy this time
If mouseclick()=0
pickmode=0
//Get old objec position
`If pick object(mousex(),mousey(),Object,Object)>0
If Object > 0
`If Object Exist(Object) = 1
//This way the object will not jum to 000 position automatically
OBPX# = Object Position X(Object)
OBPY# = Object Position Y(Object)
OBPZ# = Object Position Z(Object)
set cursor 0,0 : print OBPX#," ",OBPY#," ",OBPZ#, " `De-Bug testing"
`Endif
Endif
`Endif
Endif
If mouseclick()>0
If pick object(mousex(),mousey(),Object,Object)>0 ///////////////////////
If pickmode=0
d#=get pick distance()
x#=get pick vector x():y#=get pick vector y():z#=get pick vector z()
`print "object x ",x#," object y ",y#," object z ",z#," distance ",d# `De-Bug testiing
Inc pickmode
Endif
Endif
if pickmode=1
pick screen mousex(),mousey(),d#
dx#=x#-get pick vector x():dy#=y#-get pick vector y():dz#=z#-get pick vector z()
` Endif
//Position using the old object position and the new pick object values
If Mouseclick() = 1 Then Position object Object,OBPX# - dx#,Object Position Y(Object),OBPZ# - dz#
//Position using the old object position and the new pick object values
If Mouseclick() = 2 Then Position object Object,OBPX# - dx#,dy#,OBPZ# - dz#
Endif //////////////////////
Endif
Endfunction
This works, Thanks

But when the camera is at different angles and at different static positions the object i'm moving tends to jump around.
Quote: "Where do you want to go to? "
Also do you mean what direction do I want to take this?
Well, I didnt include camera movement into the code before but, I'm try to get smooth movement(no flying objects) from any camera angle or position(Reletive to the object's position), especially when detecting collisions.
Thanks for replying BTW pcRaider. Didnt think anyone would lol