I have an object in my game that I would like the player to freely scale as he pleases. After trying a lot of different approaches my code eventually settled like this:
public void OnScaleSliderValueChanged(float value)
{
var scale = minScale - value * (minScale - maxScale) / 100f;
arSessionOrigin.transform.localScale = new Vector3(scale, scale, scale);
}
And here is how it actually behaves:
https://vimeo.com/325157145
The issue here is that the object does not only scale but it also moves vertically. Is there any clever way (without manually changing the object’s Y axis) to force it to stay on the ground?
Hi
Is the object actually “moving” up in Y? Or are you just seeing the effect of scaling… but the pivot point is staying locked to its position? Can you move your device down to a side on view before and after scale…
https://vimeo.com/325416633
Honestly, I have no idea what’s going on. As it seems the scaling is working perfectly when looking at the object from the side but the moment I get up it starts going up as well.
I noticed the tracking moved… assuming that’s all setup ok, maybe try place your object on a surface with more detail, just to be sure you’re not loosing tracking when you are getting up in that example.
As far as looking down on the object, I think the “illusion” is its moving up, but its just scaling in the frame… not getting closer (Unless the pivot is at the base… so the height of the terrain will make the highest point move up… but the pivot stays at 0
That’s what it looks like to me… again, assuming all else is setup and working ok
Hello,
I know your post is a bit old but I have exactly the same problem. Did you find a solution to it or is it the tracking not working well?
Thanks in advance!