unity3d - object movement as wave in Unity 3d -
i created object in unity
gameobject monsterclone = (gameobject)instantiate(monsterprefab, floorposition, quaternion.identity);
this object should move in wave style limit1 limit2.
then move limit2 limit1.
y position x position have change in specific way.
vector3 npos = mfloorpos + new vector3(2f, 0f, 0f); vector3 opos = mfloorpos + new vector3(-2f, 0f, 0f);
how can it?
i can't write code without knowing more specific think question asked link out move object wave
edit:
i think flat , float down functionality work moving 1 point example:
var floatup; function start(){ floatup = false; } function update(){ if(floatup) floatingup(); else if(!floatup) floatingdown(); } function floatingup(){ transform.position.y += 0.3 * time.deltatime; yield waitforseconds(1); floatup = false; } function floatingdown(){ transform.position.y -= 0.3 * time.deltatime;; yield waitforseconds(1); floatup = true; }
Comments
Post a Comment