Bug in TSPhysics2D

espii
espii
Found a bug in TSPhysics2D

Comments

  • espii
    espii
    edited December 2017
    TSPhysics2D.circlecast
    NullReferenceException: Object reference not set to an instance of an object
    TrueSync.TSPhysics2D._CircleCast (TSVector2 origin, FP radius, TSVector2 direction, FP distance, BodySpecialSensor sensorType, Int32 layerMask) (at Assets/TrueSync/Unity/TSPhysics2D.cs:249)
    TrueSync.TSPhysics2D.CircleCastAll (TSVector2 origin, FP radius, TSVector2 direction, FP distance, Int32 layerMask) (at Assets/TrueSync/Unity/TSPhysics2D.cs:282)
    PathfindingComponent.RaycastMovableCheck (FP radius, TSVector2 point1, TSVector2 point2) (at Assets/Pathfinding/PathfindingComponent.cs:194)
    PathfindingComponent.SimplifyPath (System.Collections.Generic.List`1 path) (at Assets/Pathfinding/PathfindingComponent.cs:175)
    PathfindingComponent.MoveToPosition (TSVector2 pos) (at Assets/Pathfinding/PathfindingComponent.cs:137)
    Unit.OnSyncedUpdate () (at Assets/Unorganized/Unit.cs:31)
    TrueSync.TrueSyncManagedBehaviour.OnSyncedUpdate ()
    TrueSync.TrueSyncManager.OnStepUpdate (System.Collections.Generic.List`1 allInputData) (at Assets/TrueSync/Unity/TrueSyncManager.cs:796)
    TrueSync.AbstractLockstep.ExecutePhysicsStep (System.Collections.Generic.List`1 data, Int32 syncedDataTick)
    TrueSync.AbstractLockstep.Update ()
    TrueSync.TrueSyncManager.FixedUpdate () (at Assets/TrueSync/Unity/TrueSyncManager.cs:713)
  • espii
    espii
    edited December 2017
    when I use the debugger, the code dies in the file TSPhysics2D at the line:

    object result = _OverlapCapsule(center, new TSVector2(distance + radius * 2, radius * 2), TSCapsuleDirection2D.HORIZONTAL, -angle, sensorType, layerMask);
    if (result is TSCollider2D) {
    return new TSRaycastHit2D((TSCollider2D) result);
    } else {
    TSCollider2D[] resultAux = (TSCollider2D[]) result;
    TSRaycastHit2D[] resultHit = new TSRaycastHit2D[resultAux.Length];

    because resultAux is null and the result was null
  • espii
    espii
    edited December 2017
    I found the solution to this bug