I’m trying to translate a vector and then apply that to the mesh.position instead of working directly on the mesh but am having some trouble.
What works is:
// during setup this.posStart = this.plane.position.clone(); // this is in the render loop this.plane.position = this.posStart; this.plane.locallyTranslate(new Vector3(0, 0, z));
// Result is moving from a fixed position and not incrementing on movement
Issue is I don’t want to have to set the position of the plane to posStart every time and instead work with a vector and then only apply that position to the mesh once it’s been calculated. Something like:
// during setup var posStart = this.plane.position.clone(); // this happens in render loop var newPos = this.posStart.clone(); newPos.translate(Axis.Y,2,Space.WORLD); // ERROR: newPos.translate is not a function this.plane.position = newPos;
What would be the best way to do this?