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.

Has a solution been found for this yet? My problem is the very same thing and also have the solution when i set the z to 1. Fixes the problem but its very flat.

can you share a video of the issue? does the model appear more stable if you set scale to something smaller, like 5 or 10?

depthkit.scale.set(5, 5, 5)

Hi @Evan, the issue is the same if we reduce the scale. Here is a video of the issue, where the object is moving. Could you please help fix this issue? Thank you