- Home /
Translation problem
I am simply trying to move a player when I click a spot on the terrain.
currentPlayer = WorldManager.GetInstance().GetCurrentPlayer();
var newMapPosition = MapScript.GetInstance().GetMapPosition( hexPosition );
currentPlayer.transform.Translate( newMapPosition * Time.deltaTime );
I don't think I know what exactly the translate function is supposed to do.
I have tried many of different approaches but it seems to me that this should be a simple function to use.
Any help would be appreciated
Answer by Eric5h5 · May 06, 2010 at 07:30 PM
transform.Translate moves relative to the object you're translating (as opposed to setting transform.position directly, which sets an absolute position). If you're trying to move to another position over time, use something like this.
Awesome man thank you. this script is exactly what I was looking for. thanks again.
@$$anonymous$$ike: Good to hear, but please accept the answer so that the question is marked solved.
Your answer
Follow this Question
Related Questions
Vector-based movement? 1 Answer
JS to C# Translation? 2 Answers
Having a problem translating part of a script which uses C# delegates into JS 0 Answers
Random Movment using if statments 2 Answers
How to Attach Steering wheel script to a car moment script 2 Answers