Camera picking

Blitz3D Forums/Blitz3D Programming/Camera picking

Chimeara(Posted 2004) [#1]
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.


jfk EO-11110(Posted 2004) [#2]
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.


Chimeara(Posted 2004) [#3]
All sorted out now