Image target - object is moving

Hi,
I am using Image targets to place an object, but my object does not stay at the same place when I move my device, it changes position around the image when I move my phone.
I am using a script similar to the following project:

Is there a way to prevent the object from moving?

Thank you.

Hi Noel,

Does it behave the same way as the sample project? Depending on what you’ve changed it could be a variety of things.

Hi George,
I don’t think it’s something I changed, because when I replace my object by the jelly fish model in my project, everything works fine and the object does not move when I move the device.
I have the following code:
" const showTarget = ({detail}) => {
if (detail.name === ‘video-target’) {
depthkit.position.copy(detail.position)
depthkit.quaternion.copy(detail.rotation)
depthkit.scale.set(detail.scale = 20, detail.scale = 20, detail.scale = 20)
depthkit.video.muted = false
depthkit.visible = true
depthkit.video.play()
}
}"

I noticed that on the line “depthkit.scale.set”, when I update the last parameter as follows:
“depthkit.scale.set(detail.scale = 20, detail.scale = 20, detail.scale = 1)”, there is no issue anymore and the object stops moving when moving the device (but the object looks flat).

Any ideas what may be causing this issue and how to solve it?

Thank you.