Object not follow snap to surface

Hi, I’ve drag control on the object set it’s mode to Snap to surface. But the object keep getting inside the surface when I try to move it, instead of staying over it.
I don’t have any collider on the object and the surface im using is a plane.

Is there something I have to add or look for on the surface or object so it works properly?

Hello Saad Baig,

To ensure that your object properly snaps to the surface, you might need to consider the following steps:

  1. Check Snap Settings: Make sure the snapping settings are correctly configured. If there’s an option to set snap offsets or distances, ensure it’s not allowing the object to penetrate the surface.

  2. Add Colliders: Even though you mentioned there are no colliders, try adding a collider (e.g., a box collider) to both the object and the plane. This might help the snap process to calculate the surface interaction more reliably.

  3. Surface Normal: Verify that the normals of the plane are facing upwards. If they are inverted, snapping might not behave as expected.

  4. Height Offset: If the tool or software has the ability to set a snap height offset, ensure it’s correctly set to prevent objects from penetrating the surface.

  5. Drag Control Options: Double-check the options in the drag control settings to ensure they are not set to ignore surface interactions.

  6. Script Adjustments: If this is being handled in a script, ensure the logic doesn’t allow the object to move through the plane under any conditions.

If these don’t resolve the issue, could you provide more details or logs from Needle Engine or Unity for further inspection? You can use the “Copy Project Info Into Clipboard” option in Unity to provide the necessary context.

24 replies left
thread_AogMKKOVh84at4iKhmKIGghk
Reply to this message to continue the conversation


this is how my cube looks like with Drag control and drag mode set to Snap to surface. The ground and the cube has box collider on it.

Hello Saad Baig,

Thank you for providing the images. Given that both the cube and the ground have box colliders, here’s a checklist to help troubleshoot why the snapping might not be working correctly:

  1. Collider Size: Ensure that the colliders’ sizes are appropriately set, especially for the cube. If the collider is smaller or not aligned with the visual representation of the cube, it may not snap as expected.

  2. Snap Distance Settings: Look for any settings related to the snap distance or offset in the dragging control setup. Ensure that this is not set too low, which might allow the cube to intersect with the ground.

  3. Physics Settings: Check the physics settings in your project. Sometimes, settings related to gravity or collision layers may affect how objects interact with each other.

  4. Z-Axis Positioning: Make sure the cube isn’t initially positioned below the plane. If it starts below the surface, it will likely snap to the ground and visually appear to penetrate it.

  5. Snap to Surface Implementation: Ensure that the snap to surface behavior is correctly implemented in your code or setup. If you have any scripts that manage the dragging and snapping, verify that they correctly reference the colliders.

  6. Object Layer: If your objects are on different layers, check that the layers are set to interact in the physics settings.

If you still face issues after these checks, consider providing logs from Needle Engine using the “Help/Needle/Logs” option for deeper insights.

24 replies left
thread_AogMKKOVh84at4iKhmKIGghk
Reply to this message to continue the conversation

not helping

Hello Saad Baig,

I understand this issue can be frustrating. To provide more tailored assistance, could you please share the logs from Needle Engine? You can find these in the “Help/Needle/Logs” menu. This will help me diagnose the problem more specifically.

24 replies left
thread_AogMKKOVh84at4iKhmKIGghk
Reply to this message to continue the conversation

Hi @saad_baig can you try reducing the snap grid resolution to 0?

I started with 0, it’s the same issue so I tried to increase it to 1.

any findings?

I’ve tried to reproduce the issue with cubes and planes here without success.

Colliders are not necessary on any object (they’re just used for physics calculations).

The snap to surface detects the closest surface point below the cursor (it ignored the object that you’re currently dragging). Is it possible that your floor is on the IgnoreRaycast layer?

It looks like it works on a plane but not on the 3D model. you test it here https://saaddevtesting.netlify.app/

Grey is the plane from Unity.


And this on my 3D model.

Hi, did you check the layer of your plane in Unity to make sure it’s not set to “IgnoreRaycast” ?

Yes its not set to IgnoreRaycast. It’s set to default. Could be the problem with the 3D model ?

I’m not sure, could you send the scene as a bugreport so we can look at it?

I just sent it now.

1 Like

Hey, Any update on the issue?

Hi, I’m looking at it now

1 Like

Hi, it’s caused by DragControls set to SnapToSurface was not handling the rotation of the object. It will be fixed in the next release. Until then you could try to eliminate the rotation of your room model

Thanks marcel. What do you mean by eliminate the rotation of room model? Should it be set to 0,0,0 ?

Yes, the model must currently not be rotated at all (Mesh_25 + none of the parents, so it would need to be fixed in your 3D software to apply the rotation to the geometry)