- Home /
Unity2d : How do you constrain the transform pos z of all objects to 0 when using uniducial.
Hi guys maybe someone can offer some help.
So I am using unity with uniducial and am using 2d colliders to see when objects overlap using the bounds intersects.
When testing the software by moving the objects manually all seems to work fine however with the introduction of a real fiducial(tracked using the camera) the collision detection stopped working.
After a few coffees I found that I had not accidentally deleted some code but in fact it was the fiducial controller which was changing the position of the gameobject in the z axis.
During play mode trying to correct the z axis of the gameobject does not work since it reverts back to what is was upon pressing enter, unlike other objects which do not have that script attached.
I have attempted to create a new vector3 image from the new position and replace the z position with 0 from it's 7+ mark, just before the gameobject is assigned the new vector 3 however during gameplay the z axis yet again does not play well and end up at 7.65035.
Can anyone shed some light on 1) this behaviour (which is probably related to the actual script Fiducial Controller and not unity per se) 2) Is there a better way to detect when two objects overlap on a canvas when objects are not on the same z axis and when moving the gameobject using its transform and not applying forces.
Thank you.
Your answer
![](https://koobas.hobune.stream/wayback/20220612104209im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
2DRigidbody freaks out when constraints frozen 0 Answers
Can I upgrade my license? 0 Answers
How to make the tower shoot at the one who is closer to the finish line? 0 Answers
Unity2D resize the sprite 0 Answers
UI RPG Dialog Sytem 0 Answers