Right click position
by Fred Kask · in Combat Starter Kit · 09/06/2008 (6:14 am) · 2 replies
I modified the right click commander function so that I could move my player to the click location. The problem is that somethings after the right click,the player is floating in air or under the terrain. Does not place at the z location. I also notice that the player locatiions before the move and after the right click has a large negative value for the z axes. The location to move to is fine.
About the author
#2
09/10/2008 (6:25 am)
If the mission has alot of mountains then the playere move is good. But on a flat mission the player move is always bad in that the playere is floating in air or under ground but never reachs the actual terrain.
Torque 3D Owner Jon Paynter
to get the terrain height, there is a function: "getTerrainHeight()" that will return the z elevation for a given terrain position.
Look in example\creator\editor\objectBuilderGui.gui near the end for some examples of how to call that function, specificly the function "SetFlagOnGround"
If you try some of the prefabs available in the mission editor, you can see them in action.