Game Development Community

have moving problem

by Enel · in Torque 3D Professional · 04/21/2010 (2:03 am) · 3 replies

i have make a player by AIplayer class and use setMoveDestination function to move but it is just move by Click

i want to move player by keyboard input but keyboard input is ignore by bottom code

movelist.cpp Function - MoveList::getNextMove(Move &curMove)
if (mConnection->getControlObject())
      mConnection->getControlObject()->preprocessMove(&curMove);

but i have displace code like this
if(mConnection->getCameraObject()){
	   Camera* pCamera = static_cast<Camera*>(mConnection->getCameraObject());

	   if(pCamera->getOrbitObject())
		   pCamera->getOrbitObject()->preprocessMove(&curMove);
   }

but.. it is memory unable access :(..

how can i do control player by CameraObject~?

#1
04/21/2010 (4:12 am)
the move by click function is included in the RTS Prototype - docs.torquepowered.com/torque-3d/official/content/documentation/Scripting/Advanc...
#2
04/21/2010 (6:37 am)
@Jacob

omg.. you didnt catch my problem

i want to move both click and keyboard
#3
04/21/2010 (7:08 am)
I see what you are wanting - You want to be able to move the player using either keyboard or click-to-move commands. You can handle this with the TorqueScript keybinds. The tutorial Jacob linked explains how to cause the player to move to a click location, but if you review it you should be able to determine how to keep the keyboard movement as well. You shouldn't need to make a source code change to make this work.

I watched your demo yesterday - great work!