- Home /
Move from point A to point B, then destroy? ( java S)
Hi, I got two empty game object called A and B respectively, and a cube. How to i make a cube move from A to B upon instantiation and destroy itself after the moving part is done? Is it possible to use Transform.translate in this case? Thanks!
Answer by Eric5h5 · Mar 07, 2011 at 07:24 AM
http://www.unifycommunity.com/wiki/index.php?title=MoveObject
var pointA : Transform; var pointB : Transform; var moveSpeed = 1.0;
function Start () { yield MoveObject.use.Translation (transform, pointA.position, pointB.position, moveSpeed, MoveType.Speed); Destroy (gameObject); }
wow, thanks for such a quick reply, and sorry cuz i didnt search the net well before posting this answer!
Answer by temporal · Oct 21, 2011 at 05:11 AM
There is something wrong with ur script Eric5h5. I don't know why but I'm getting an error. It says "unknown identifier: MoveObject" at 6,11. How can I fix it?
There's nothing wrong with that code. Did you follow that link he also posted there? You can't just copypasta this stuff! You also need to be using that script, which is on the wiki.
Your answer
Follow this Question
Related Questions
Translate code from C# to Javascript 1 Answer
Camera to follow the mouse to move to create the point 0 Answers
Sprint Script Error?!!!! 4 Answers
How do I get my "dashing" animation to work? 1 Answer
Move many objects repeatdly 2 Answers