Search Unity

Unity Physics Discussion

Discussion in 'Data Oriented Technology Stack' started by smcclelland, Mar 18, 2019.

  1. SamOld

    SamOld

    Joined:
    Aug 17, 2018
    Posts:
    97
    The old manual versions seem to be what come up on google for most of the packages, I've fallen into that trap before. It seems like somebody at Unity needs to mess with some SEO stuff somewhere to prioritise the latest versions.
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,198
    Unfortunately they change constantly names and not realizing changing links to repositories. Which leads to broken links, which were once posted. These which wasn't broken, stay on top of search engine results, leading to outdated information, like docs.

    In fact, is better when link is broken, than not updated. Specially at current state of DOTS. Lesser of two evils.
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,198
    Last edited: Aug 14, 2019
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,198
  5. mnarimani

    mnarimani

    Joined:
    Mar 27, 2017
    Posts:
    184
    Hi. I get this error randomly in my console:
    Code (CSharp):
    1. TypeLoadException: Recursive type definition detected
    Code (CSharp):
    1. IndexOutOfRangeException: Index -1062612832 is out of range of '3' Length.
    2. Unity.Collections.NativeArray`1[T].FailOutOfRangeError (System.Int32 index) (at <8e57d4f652b945d9a17953823be083fc>:0)
    3. Unity.Collections.NativeArray`1[T].CheckElementReadAccess (System.Int32 index) (at <8e57d4f652b945d9a17953823be083fc>:0)
    4. Unity.Collections.NativeArray`1[T].get_Item (System.Int32 index) (at <8e57d4f652b945d9a17953823be083fc>:0)
    5. Unity.Physics.BoundingVolumeHierarchy.Refit (Unity.Collections.NativeArray`1[T] aabbs, System.Int32 nodeStartIndex, System.Int32 nodeEndIndex) (at Packages/com.unity.physics@0.2.0-preview/Unity.Physics/Collision/Geometry/BoundingVolumeHierarchyBuilder.cs:564)
    6. Unity.Physics.BoundingVolumeHierarchy+FinalizeTreeJob.Execute () (at Packages/com.unity.physics@0.2.0-preview/Unity.Physics/Collision/Geometry/BoundingVolumeHierarchyBuilder.cs:842)
    7. Unity.Jobs.IJobExtensions+JobStruct`1[T].Execute (T& data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <8e57d4f652b945d9a17953823be083fc>:0)
    What is the problem and how can I fix it?
     
  6. mnarimani

    mnarimani

    Joined:
    Mar 27, 2017
    Posts:
    184
    I'm using this code to run physics on Fixed Update:
    Code (CSharp):
    1. public class PhysicsRunner : MonoBehaviour
    2.     {
    3.         private BuildPhysicsWorld buildPhysicsWorld;
    4.         private StepPhysicsWorld stepPhysicsWorld;
    5.         private ExportPhysicsWorld exportPhysicsWorld;
    6.         private EndFramePhysicsSystem endFramePhysicsSystem;
    7.  
    8.         private void Awake()
    9.         {
    10.             buildPhysicsWorld = World.Active.GetOrCreateSystem<BuildPhysicsWorld>();
    11.             stepPhysicsWorld = World.Active.GetOrCreateSystem<StepPhysicsWorld>();
    12.             exportPhysicsWorld = World.Active.GetOrCreateSystem<ExportPhysicsWorld>();
    13.             endFramePhysicsSystem= World.Active.GetOrCreateSystem<EndFramePhysicsSystem>();
    14.         }
    15.  
    16.         private void FixedUpdate()
    17.         {
    18.             buildPhysicsWorld.Update();
    19.             stepPhysicsWorld.Update();
    20.             exportPhysicsWorld.Update();
    21.             endFramePhysicsSystem.Update();
    22.         }
    23.     }
    I have added [DisableAutoCreation] to systems. Can this break Unity Physics?
     
  7. linfuqing

    linfuqing

    Joined:
    May 11, 2015
    Posts:
    28
    Hi,I need call physics systems by a custom timestep instead of fixedTime.Have any plan about this?
     
  8. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,198
    Checkout samples on github. There are 2 examples for variable and fixed times.
     
  9. linfuqing

    linfuqing

    Joined:
    May 11, 2015
    Posts:
    28
    I mean to change line 268 in BuildPhysicsWorld.cs and line 101 in StepPhysicsWorld.cs,how can i do?
    My physics package version is 0.2.0