ExtendRealityLtd / ExtendRealityLtd/Tilia.Interactions.Controllables.Unity

The AngularJointDrive's InitialTarget feature seems to be broken when the container is rotated before being instantiated

Open
#116 5 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
9
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### Environment
* Code version: Controllables package v1.12.1
* Platform version: Tested on Unity 2020.3.2f1 and 2020.3.0f1
* All packages used:
"io.extendreality.tilia.camerarigs.spatialsimulator.unity": "1.4.1",
"io.extendreality.tilia.camerarigs.trackedalias.unity": "1.6.0",
"io.extendreality.tilia.interactions.controllables.unity": "1.12.1",
"io.extendreality.tilia.interactions.interactables.unity": "1.17.0",
"io.extendreality.tilia.mutators.collisionignorer.unity": "1.2.0",

### Steps to reproduce

1. Create an new unity scene set up with tracked alias and a spatial simulator with grab support.
2. Create an interactable door, following the [door creation tutorial](https://github.com/ExtendRealityLtd/Tilia.Interactions.Controllables.Unity/tree/master/Documentation/HowToGuides/CreatingADoor).
3. Modify the AngularDriveFacade properties of the door as follow :
![alt text](https://i.ibb.co/zSvm2fV/Angular-Drive-Facade-Properties.png)
It should get the door to be shut (y angle to 0) at start.
4. Create a prefab from that door and remove it from the scene hierarchy.
5. Duplicate the door prefab and name the second prefab "DoorRotated". Then modify the **root gameobject** y rotation (not the angular facade driver gameobject). Set it to 10 or any positive value for example.
![image](https://user-images.githubusercontent.com/851993/114108750-0dfb6500-98d4-11eb-83ea-2a77939065a8.png)
6. Create a script that will instantiate a prefab (that will be referenced in a public field on that script) in the scene at start and put it on an empty gameobject in the scene.
```csharp
using UnityEngine;

public class TestSpawner : MonoBehaviour {
public GameObject objectToSpawn;
void Start() => Instantiate(objectToSpawn);
}
```
7. Make the script instantiate the door with no rotation first. Observe that the door is properly closed.
8. Make the script instantiate the door with a rotation on the y axis. Observe that the door will spawn **opened**.

### Expected behavior

With both prefabs being the same but the root gameobject y axis rotation, the door should spawn with the same initial target value. The only thing changing should be the overal rotation of the container of the door parts (frame + door).

### Current behavior

Now, with no rotation set is properly closed, while the door with the root gameobject slightly rotated on the y axis is opened at start.

Gif illustration :
![alt text](https://i.ibb.co/cyVyf94/DoorBug3.gif)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.