MindPort-GmbH/VR-Builder

Snap zones don't snap correctly objects with attach transform

Opened this issue · 3 comments

Objects with attach transform can be oriented incorrectly when snapped to a snap zone.

User Ashes apparently solved this:

The snapzone script has two functions:

  1. ForceSelect
  2. DrawHighlightMesh

These functions are using attachtransform's transform for the snapped object. But there is an assumption here that the AttachTransform is the gameobject having the snapzonepreviewdrawer script. I simply added same condition in both these functions to check if the attachedTransform gameobject is having the snapzonepreviewdrawer script, if not then parent is used. (ofcourse I am assuming as well that the AttachTransform could only be either gameobject with SnapZonePreviewDrawer or direct child that gameobject).

SnapZone.zip

Tracking internally via MP-2143

Tracking with internal reference is MP-2143

Yeah, that was long back in August. And the assumption I made could also be a dealbreaker for few.

Okay I conclude it is an issue but your solution (I put into the zip file) might not be a fix for all use cases.
I leave this open for now if anyone wants to try to figure it out.