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

Question ArticulationBody.PublishTransform doesn't exist in 2022?

Discussion in 'Physics' started by zezba9000, Oct 21, 2023.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    I'm trying to get the position and rotation of a ArticulationBody in FixedUpdate after each time it updates.
    How do I do this without PublishTransforms as ArticulationBody is missing position and rotation?
     
  2. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    Ok never mind figured it out.
    Simply pulling the transform from a ArticulationBody does the same thing as far as I can tell.
    So made an extension method helper so I can use Unity 2022.3.11 instead.

    Code (CSharp):
    1. public static class PhysicsUtils
    2. {
    3.     public static Transform PublishTransformEx(this ArticulationBody rigidbody)
    4.     {
    5.         return rigidbody.transform;
    6.     }
    7. }