Moving objects
Blitz3D Forums/Blitz3D Programming/Moving objects
| ||
Hey i need a code that if you click on an object then you can move it around and click and it will stay in that position. You could also do this with other objects.I tried doing this with entitypickmode but when i moved one object it moved all of them. I would appretiate help. |
| ||
Show us your code. |
| ||
my code is messed up. But the problem was when the entitypick picked any object with a mode on it it would do both commands. The commands were to copy the ball or pipe. It coppied both of them and i could move both of them. Is there a way to use this command or just another command to do this? |
| ||
A simple code that replicates the problem? Don't see why this should happen given the fact that you store the last picked object in a global variable named "activeObject" and only move that when you move the mouse. |
| ||
What do youu mean by 'do both commands'? Sounds like your parenting the objects to each other or something daft like that - therefore moving the parent will move the children. Need some code to see what the issue is though. Stevie |
| ||
Can somone give me a example code that you can move 2 objects though. My code is gone. It was deleted accendently. |
| ||
just some pseudo code. assuming both objects have polygonal pickmode set etc.if mousehit(1) then if inhand=0 then pick=camerapick(camera,mousex(),mousey()) if pick <>0 inhand=pick endif else inhand=0 endif endif if inhand<>0 then positionentity inhand, mousex(),0,mousey(),1 ; of course you need a better drag object code here endif |
| ||
Thanks jfk!It works now |
| ||
i don't understand. his code was deleted (when you write your code backup it!), but when he had few line of jfk's code his code works right!i don't understand |
| ||
ok i cant get it to work...(im new) |
| ||
Post your code. |