mouse control

Blitz3D Forums/Blitz3D Beginners Area/mouse control

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Maybe somthing like this?

;on the mesh being picked 
EntityPickMode mesh,2


If Mousehit(1) ; if the left mousebutton is hit
 pick= CameraPick(camera,MouseX(),MouseY())
            If pick <> 0
            x# = PickedX()
            y# = PickedY()
            z# = PickedZ()
            Positionentity Character,x#,y#,z#
            EndIf
EndIf 



camerapick returns the exact values of where it was picked, so that would be your "spot" on the mesh.
You can get the coords from camerapick by storing
pickedx(), pickedy(), and pickedz() in float points.
Then you just move to that location.