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. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    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?