- Home /
Move terrain towards object? (illusion of moving forward)
So I did this: targetterrain.transform.Translate(Vector3.back * Time.deltaTime * 40);
and it works, but the problem is this obviously only works when your facing directly forward. How would I make it so that the Terrain always moves towards whatever direction you are facing, giving the illusion of the object going forward quickly? I can't have the object move forward on its own because of a bug with the SDK that I'm using this for. Any help would be greatly appricated, thanks!
Answer by 3 · Jan 27, 2013 at 07:02 AM
Never mind, after around 6 hours straight of trying to figure it out, I got it, for anyone who stumbles upon this and needs some help:
targetterrain.transform.Translate(Vector3.forward * Time.deltaTime * 100, target.transform);
the , target.transform part makes it so that you move relative to the location of the target, which I assigned to be the player.
Problem solved, case closed, problema resuelto, הבעיה נפתרה, 问题解决了, 問題解決, حل المشكلة.
In case you don't speak english, though I doubt you would be here if that was true, here you go:
לא נורא, לאחר סביב 6 שעות רצופות של מנסה להבין את זה, יש לי את זה, לכל מי שכושל על זה וזקוק לקצת עזרה:
targetterrain.transform.Translate (Vector3.forward Time.deltaTime 100 target.transform);
, target.transform זה חלק עושה את זה כדי שתעבור ביחס למיקומו של היעד, שבו אני מוקצה
気にしないで、まっすぐにそれを把握しようとしているのは約6時間後に、私はこれに遭遇し、いくつかの助けを必要とする人のために、それを得た:
targetterrain.transform.Translate(Vector3.forward* Time.deltaTime* 100、target.transform);
、 target.transform部分では、そうすることは、私が選手に割り当てられたターゲットの位置に対して相対的に移動することになります。
لا يهم، بعد حوالي 6 ساعات متواصلة من محاولة الرقم بها، حصلت عليه، لمن يتعثر على هذا ويحتاج بعض المساعدة:
没关系,直试图弄明白约6小时后,我得到了它,任何人都绊倒在此需要一些帮助:
targetterrain.transform.Translate(Vector3.forward* Time.deltaTime* 100,target.transform);
的target.transform*,*部分,使得它让你相对移动的位置,这是我的目标分配给玩家。
No importa, después de alrededor de 6 horas sin parar de tratar de entenderlo, lo tengo, para cualquier persona que se encuentra con esto y necesita un poco de ayuda:
targetterrain.transform.Translate (Vector3.forward Time.deltaTime 100, target.transform);
la parte , target.transform hace de modo que se mueve con relación a la localización del objetivo, lo que he asignado para ser el jugador.
What? I had some free time... and thanks for the help everyone! A Shining example of how the unity community works together! Just kidding of course, I've mostly had great experiences with everyone here and I'm greatful for previous support.