Camera picking

Blitz3D Forums/Blitz3D Programming/Camera picking

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.

If ImageRectCollide(buttons2,705,0,0,MouseX(),MouseY(),4,8)
If MouseHit(1)
movrod=6
EndIf
EndIf ;-if the button is clicked movrod becomes 6


If movrod=6
If MouseHit(1)
modelverb=CameraPick(camera,MouseX(),MouseY EndIf
EndIf

selectmodel$=modelverb ;the Picked becomes the selected

;Now this all works but when you click on another button moverod ceases to be 6, which makes selectmodel$ nolonger equil the last picked .

To make it even more confusing selectmodel$ can have other values if certain stuff happens eg if a new is created or loaded it becomes the selected .

now what i want is for selectmodel to = the last picked entity by camera pick but not if a is selected by a differnt way.

selectmodel$ ?

this should not be a string. Use it without the $. Camerapick returns an integer number which is the handle of the picked entity. if you store this in a String, it will only convert the number to text - which is pretty useless.

All sorted out now