Character Model not tweening

So I am using:

var CharactermO;
CharactermO = scene.getObjectByName("Sprinkle_Material_0");

To get my models name and then I have this to tween it:

function onClick() {
    event.preventDefault();
    mouse.x = (event.clientX / window.innerWidth) * 2 - 1;
    mouse.y = -(event.clientY / window.innerHeight) * 2 + 1;
    raycaster.setFromCamera(mouse, camera);
    var intersects = raycaster.intersectObjects(scene.children, true);

    //Get Object Name
    CharactermO = scene.getObjectByName("Sprinkle_Material_0");


    if (intersects.length > 0) {

        var clickedID = intersects[0].object.uuid;
        var clickedName = intersects[0].object.name;
        console.log("You clicked: " + clickedName);
        console.log("UUID: " + clickedID);

        if (intersects[0].object.name == 'CharacterOne') {

            $('body').css('cursor', 'default');
             if (CharactermO.position.x === -0.5 && CharactermO.position.z === -1.7) {

                tween = new TWEEN.Tween(CharactermO.position).to({
                    z: -1.0
                }, 2000).onComplete(function() {
                    tween = new TWEEN.Tween(CharactermO.position).to({
                        x: 0.05
                    }, 2000).onComplete(function() {}).start();
                }).start();

            }
        }
    }
}

But it doesn’t seem to be doing anything and I am getting no errors
Here is a fiddle:

Fiddle of Model NOT tweening: https://jsfiddle.net/v0f61jLq/

I’ve also done this with a standard cube with a name and this works: https://jsfiddle.net/2Lrkshey/

if I console.log(CharactermO); it also returns the object correctly
Click the boxes to tween
Any idea’s?

Can you please provide a smaller test case demonstrating the issue? Right now, the fiddle almost has 1000 lines of code and the Tween.js related logic is very complex…

Thank you for the reply,
Sorry I forgot about this post, I managed to work out the problem, the character model position wasn’t exactly the same as the cubes and also I assume because the model was a different size to the cubes the tween paths were all off so I had to do them all again
so for example

CharactermO.position.x === -0.5 && CharactermO.position.z === -1.7

Became

CharactermO.position.x === -400 && CharactermO.position.z === -600

I do have another question for you that involves either zooming in with orbit controls or scaling the entire scene at once(more than 1 model)
but I’ll leave that on a new post!

:slight_smile: