Game Development Community

Move character to mouse click

by Chris Bowles · in Technical Issues · 09/02/2007 (11:44 am) · 23 replies

I'm trying to modify Torque so that I can click on the terrain with the mouse, and the character will move to the point at which the mouse was clicked.

Has anyone accomplished this?

I've implemented both pieces of code described here:

http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=2173
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3645

However, this has just given me the option to toggle to mouse movement (pressing M) which then rotates the character around as I move the mouse.

I'd like to be able to click any piece of terrain, and have the character walk directly to that point.

Any help is appreciated! :)
Page«First 1 2 Next»
#21
05/25/2009 (10:33 pm)
I also saw, GuiMeshRoadEditorCtrl::getTerrainPos(), but I'm still new to torque and not sure about exporting to TorqueScript etc...

#22
05/25/2009 (10:46 pm)
I also would be very interested to see if anyone knows how to do this with Torque 3D. We want this used in our project also.
#23
05/26/2009 (1:17 am)
@Avneet: I made some progress on this in Torque 3D, but it's not working yet.

I tried to implement getMouse3DVec() and getMouse3DPos(), described here:
www.garagegames.com/community/resources/view/7335/12#comment_form

But the values are always (0 0 0) :-(

Page«First 1 2 Next»