Locking object to a surface

BlitzMax Forums/MiniB3D Module/Locking object to a surface

Gavin Beard(Posted 2007) [#1]
Hi All,

In essence i create a surface and texture it to look like a sqaure of grass, i then want to place objects on the surface but i want the object i am placing to be locked to the surface as i move it around, or at least as i move the mouse around highlight a piece of the surface, not asking anyone to write it for me but just to point me in right direction, moving a textured sqaure around locked to the surface would be cool :)


bradford6(Posted 2007) [#2]
camerapick()
pickeentity()
pickedx(), y and z

essentially you need to do a camerapick (or a linepick) and place your object at the picked x,y,z coordinates.


Gavin Beard(Posted 2007) [#3]
thx Dude, will try that and how i get on :-)


bradford6(Posted 2007) [#4]
np. if you run into a snag. post a working code snippet and i will try to help.

don't forget to make the destination entity poly pickable (entitypickmode)


Difference(Posted 2007) [#5]
Only pick once to get the coordinates.
When they are found, make your object a child of the picked entity with http://www.blitzbasic.com/b3ddocs/command.php?name=EntityParent