Moving objects

Blitz3D Forums/Blitz3D Programming/Moving objects

Oiduts Studios(Posted 2008) [#1]
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.


Stevie G(Posted 2008) [#2]
Show us your code.


Oiduts Studios(Posted 2008) [#3]
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?


Dreamora(Posted 2008) [#4]
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.


Stevie G(Posted 2008) [#5]
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


Oiduts Studios(Posted 2008) [#6]
Can somone give me a example code that you can move 2 objects though. My code is gone. It was deleted accendently.


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



Oiduts Studios(Posted 2008) [#8]
Thanks jfk!It works now


vivaigiochi(Posted 2008) [#9]
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


Oiduts Studios(Posted 2008) [#10]
ok i cant get it to work...(im new)


Ross C(Posted 2008) [#11]
Post your code.