Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Creating bodies from scratch

Discussion in 'Physics for ECS' started by Holyren, Jun 3, 2022.

  1. Holyren

    Holyren

    Joined:
    Jul 8, 2017
    Posts:
    35
    I am trying to use the script for creating bodies from scratch in my project
    https://docs.unity3d.com/Packages/com.unity.physics@0.50/manual/interacting_with_bodies.html

    I am however not understanding how to refer to my collider for
    Collider* colliderPtr = (Collider*)collider.GetUnsafePtr();

    The collider is already created and I don't want to create it with a script. I tried to instead add the values manually, that however resulted in my entities not moving at alll.
     
  2. Holyren

    Holyren

    Joined:
    Jul 8, 2017
    Posts:
    35
    I just realized that my code does not work because I am trying to add the body to a child entity. Is there a workaround?