Skip to content

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

@ShinStalk

Description

@ShinStalk

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.
  3. Modify the AngularDriveFacade properties of the door as follow :
    alt text
    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
  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.
using UnityEngine;

public class TestSpawner : MonoBehaviour {
    public GameObject objectToSpawn;
    void Start() => Instantiate(objectToSpawn);
}
  1. Make the script instantiate the door with no rotation first. Observe that the door is properly closed.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions