LInePick and Child Objects
Blitz3D Forums/Blitz3D Programming/LInePick and Child Objects
| ||
I'm having some problems getting my proggie working correctly, but cant yet put it down to a certain bit of code. But.. I think it could be this.. I'm passing an object handle into a function that calculates the correct height, and positions it. Function fixentity_height#(ent) Pick=LinePick(EntityX#(ent),EntityY#(ent)+20,EntityZ#(ent),0,-30,0) PositionEntity ent,EntityX#(ent),PickedY#(),EntityZ#(ent) End Function Works fine if its a parent object I'm passing to it, but I'm getting some strange results when I pass a child object. (and I've defined a global variable when the object was first loaded) Can anyone help explain why ? |
| ||
This is just a guess, based on a simple assumption: I am purely guessing it's because the entities are Children, so the problem must be the conversion between Local/Global space (maybe) try the following and see if it makes much difference... The " ,1 "in the EnitityX,Y and Z commands guarantees Global Coords. |
| ||
-------------------^^-------------------- Make sure you change the PositionEntity line as well (also add a final ,1 to the end of the PositionEntity command! |
| ||
Thanks Malice.. will try it out later |