Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question How to creating a compound collider with child colliders of different scales by code

Discussion in 'Physics for ECS' started by hxhloveunity, Apr 21, 2024.

  1. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    42
    CompoundCollider.Create can only create colliders without child scale. I want to achieve this by modifying the source code. Spheres, boxes, capsules, and cylinders are relatively easy to handle since I only need to modify the Radius, Size, or Height. But what if the child is a mesh collider or another compound collider?
     
    alemnunez likes this.
  2. daniel-holz

    daniel-holz

    Unity Technologies

    Joined:
    Sep 17, 2021
    Posts:
    326
    We are rolling out a new feature very soon that will let you apply a transformation including uniform and non-uniform scale and even shear to any collider type at runtime. That should solve your issue.

    This feature will be available in an upcoming release. Stay tuned!
     
  3. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    42
    I'm very excited about this.

    I also have a question to ask. I have a compound entity whose collider is composed of colliders from entities A, B, and C merged together. After merging, I removed the PhysicsWorldIndex from EntityA, B, and C. I want to continue applying the PhysicsVelocity.Linear of EntityA or B or C to the compound entity.

    How can I achieve this?
     
  4. daniel-holz

    daniel-holz

    Unity Technologies

    Joined:
    Sep 17, 2021
    Posts:
    326
    I am happy to help with this. But I suggest you ask this in a seperate post in the forum so that people that have the same question can find the answer, and to invite others that might know the answer to contribute.

    You can share the link to the new question here then.
     
  5. hxhloveunity

    hxhloveunity

    Joined:
    May 27, 2022
    Posts:
    42
    Thanks, here is the new quesiton
     
    daniel-holz likes this.
  6. alemnunez

    alemnunez

    Joined:
    Mar 15, 2023
    Posts:
    17
    @daniel-holz any ETA for that release? I am trying to decide if I should switch to not using compound colliders for some stuff in my game or wait for this to be available.
     
  7. daniel-holz

    daniel-holz

    Unity Technologies

    Joined:
    Sep 17, 2021
    Posts:
    326
    Unfortunately we can't provide a specific timeline just yet, but it will come sooner rather than later.