I
I
IliaNeverov2020-07-07 11:07:36
JavaScript
IliaNeverov, 2020-07-07 11:07:36

Why does the 3d model not move around the scene and how to fix it?

Good day, I'm trying to make a 3d model move using this code:

var xpos = 8, maxPos = -200, start = 200; 
            const newPosition = object.position.x - xpos; //object это три д модель 
          
            if (newPosition < maxPos) {
              object.position.x = start;
            }
            else {
              object.position.x = newPosition;
            }

Please tell me what I'm doing wrong and how to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question