Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Jaw joint not work when rotating head by mouse

Discussion in 'Physics' started by jore68, Apr 19, 2017.

  1. jore68

    jore68

    Joined:
    Mar 8, 2015
    Posts:
    17
    All other joints work fine, but I have problem with upper head joint.They are Configurable joints. Upper head is connected to Jaw by using Configurable joint and jaw is connected to neck by using similar joint and neck to hover unit.

    I have one solution, where jaw is parent of upper head. It worked fine, but when I connected guns to upper head, then guns bullets not turn when I rotating head by mouse. It is allmost good. Therefore now jaw is not parent anymore.

    X Motion, Y Motion, Z Motion, Angular Y Motion, Angular Z Motion are locked and Angular X is limited.

    I think that joints not really works fine with the mouse. Maybe they not update their position right way, when the mouse rotating one joint and jointed object moves the other joint.


    Scirpt is very simple, and I think that it is not problem.

    mouseX = Input.GetAxis("Mouse X");
    mouseY = Input.GetAxis("Mouse Y");

    jawRotation = new Vector3(jawRotation.x - mouseY, jawRotation.y + mouseX, jawRotation.z);
    joint.transform.localRotation = Quaternion.Euler(jawRotation);


    Here is the video, where you can see this problem:





     
  2. jore68

    jore68

    Joined:
    Mar 8, 2015
    Posts:
    17
    The jetEngineJoint is a neck object (red).
     
    Last edited: Apr 19, 2017