Browse Source

Suspensions working

Sewmina 2 years ago
parent
commit
6b85258da0

+ 294 - 42
Assets/Scenes/SampleScene.unity

@@ -679,6 +679,249 @@ Transform:
   m_Father: {fileID: 0}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1636256662
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1636256663}
+  - component: {fileID: 1636256665}
+  - component: {fileID: 1636256664}
+  m_Layer: 0
+  m_Name: spring_rrw
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &1636256663
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1636256662}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0.9658861, y: 0.6099876, z: -1.5129414}
+  m_LocalScale: {x: 0.08194579, y: 0.08194579, z: 0.08194579}
+  m_Children: []
+  m_Father: {fileID: 7411533250134105649}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!23 &1636256664
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1636256662}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &1636256665
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1636256662}
+  m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!1 &2034951219
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2034951220}
+  - component: {fileID: 2034951222}
+  - component: {fileID: 2034951221}
+  m_Layer: 0
+  m_Name: spring_frw
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &2034951220
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2034951219}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0.90677214, y: 0.6099876, z: 1.2831329}
+  m_LocalScale: {x: 0.08194579, y: 0.08194579, z: 0.08194579}
+  m_Children: []
+  m_Father: {fileID: 7411533250134105649}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!23 &2034951221
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2034951219}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &2034951222
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2034951219}
+  m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
+--- !u!1 &2086183257
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2086183258}
+  - component: {fileID: 2086183260}
+  - component: {fileID: 2086183259}
+  m_Layer: 0
+  m_Name: spring_rlw
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &2086183258
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2086183257}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: -0.9658861, y: 0.6099876, z: -1.5129414}
+  m_LocalScale: {x: 0.08194579, y: 0.08194579, z: 0.08194579}
+  m_Children: []
+  m_Father: {fileID: 7411533250134105649}
+  m_RootOrder: 2
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!23 &2086183259
+MeshRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2086183257}
+  m_Enabled: 1
+  m_CastShadows: 1
+  m_ReceiveShadows: 1
+  m_DynamicOccludee: 1
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 2
+  m_RayTraceProcedural: 0
+  m_RenderingLayerMask: 1
+  m_RendererPriority: 0
+  m_Materials:
+  - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0}
+  m_StaticBatchInfo:
+    firstSubMesh: 0
+    subMeshCount: 0
+  m_StaticBatchRoot: {fileID: 0}
+  m_ProbeAnchor: {fileID: 0}
+  m_LightProbeVolumeOverride: {fileID: 0}
+  m_ScaleInLightmap: 1
+  m_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  m_SelectedEditorRenderState: 3
+  m_MinimumChartSize: 4
+  m_AutoUVMaxDistance: 0.5
+  m_AutoUVMaxAngle: 89
+  m_LightmapParameters: {fileID: 0}
+  m_SortingLayerID: 0
+  m_SortingLayer: 0
+  m_SortingOrder: 0
+  m_AdditionalVertexStreams: {fileID: 0}
+--- !u!33 &2086183260
+MeshFilter:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2086183257}
+  m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
 --- !u!1 &2134517332
 GameObject:
   m_ObjectHideFlags: 0
@@ -690,14 +933,13 @@ GameObject:
   - component: {fileID: 2134517333}
   - component: {fileID: 2134517336}
   - component: {fileID: 2134517335}
-  - component: {fileID: 2134517334}
   m_Layer: 0
-  m_Name: spring
+  m_Name: spring_flw
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!4 &2134517333
 Transform:
   m_ObjectHideFlags: 0
@@ -705,26 +947,13 @@ Transform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 2134517332}
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0.168, y: 0.104, z: 0}
-  m_LocalScale: {x: 0.08194579, y: 0.43217292, z: 0.08194579}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: -0.90677166, y: 0.6099876, z: 1.2831286}
+  m_LocalScale: {x: 0.08194579, y: 0.08194579, z: 0.08194579}
   m_Children: []
-  m_Father: {fileID: 1223853289183015899}
+  m_Father: {fileID: 7411533250134105649}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!65 &2134517334
-BoxCollider:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 2134517332}
-  m_Material: {fileID: 0}
-  m_IsTrigger: 0
-  m_Enabled: 1
-  serializedVersion: 2
-  m_Size: {x: 1, y: 1, z: 1}
-  m_Center: {x: 0, y: 0, z: 0}
 --- !u!23 &2134517335
 MeshRenderer:
   m_ObjectHideFlags: 0
@@ -884,10 +1113,9 @@ Transform:
   m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
   m_LocalPosition: {x: -0.90677166, y: 0.36598757, z: 1.2831286}
   m_LocalScale: {x: 1, y: 1, z: 1}
-  m_Children:
-  - {fileID: 2134517333}
+  m_Children: []
   m_Father: {fileID: 7411533250134105649}
-  m_RootOrder: 0
+  m_RootOrder: 4
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!33 &1260783703834165802
 MeshFilter:
@@ -1010,14 +1238,19 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: e50ae98834c4f5b4cb6847f30a63b13e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  suspensionJoint: {fileID: 2034951220}
   radius: 0.4
-  defaultPosition: 0
-  springConstant: 0
-  springForceMode: 2
+  restPosition: 0.5
+  restPositionOffset: 0.65
+  springConstant: 500
+  dampningFactor: 5
+  velocity: 0
   displacementRange: 0.1
-  dampningSpeed: 0.1
   hitPoint: 0
+  CurDisplacement: 0
   myCar: {fileID: 0}
+  rayDist: 0
+  force: 0
 --- !u!23 &3126323158140263403
 MeshRenderer:
   m_ObjectHideFlags: 0
@@ -1090,14 +1323,19 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: e50ae98834c4f5b4cb6847f30a63b13e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  suspensionJoint: {fileID: 1636256663}
   radius: 0.4
-  defaultPosition: 0
-  springConstant: 0
-  springForceMode: 2
+  restPosition: 0.5
+  restPositionOffset: 0.65
+  springConstant: 500
+  dampningFactor: 5
+  velocity: 0
   displacementRange: 0.1
-  dampningSpeed: 0.1
   hitPoint: 0
+  CurDisplacement: 0
   myCar: {fileID: 0}
+  rayDist: 0
+  force: 0
 --- !u!1 &3354373785630126000
 GameObject:
   m_ObjectHideFlags: 0
@@ -1129,14 +1367,19 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: e50ae98834c4f5b4cb6847f30a63b13e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  suspensionJoint: {fileID: 2086183258}
   radius: 0.4
-  defaultPosition: 0
-  springConstant: 0
-  springForceMode: 2
+  restPosition: 0.5
+  restPositionOffset: 0.65
+  springConstant: 500
+  dampningFactor: 5
+  velocity: 0
   displacementRange: 0.1
-  dampningSpeed: 0.1
   hitPoint: 0
+  CurDisplacement: 0
   myCar: {fileID: 0}
+  rayDist: 0
+  force: 0
 --- !u!23 &3762480873145737400
 MeshRenderer:
   m_ObjectHideFlags: 0
@@ -1190,7 +1433,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 7411533250134105649}
-  m_RootOrder: 2
+  m_RootOrder: 6
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!33 &3847812172065456403
 MeshFilter:
@@ -1315,14 +1558,19 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: e50ae98834c4f5b4cb6847f30a63b13e, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
+  suspensionJoint: {fileID: 2134517333}
   radius: 0.4
-  defaultPosition: 0
-  springConstant: 0
-  springForceMode: 2
+  restPosition: 0.5
+  restPositionOffset: 0.65
+  springConstant: 500
+  dampningFactor: 5
+  velocity: 0
   displacementRange: 0.1
-  dampningSpeed: 0.1
   hitPoint: 0
+  CurDisplacement: 0
   myCar: {fileID: 0}
+  rayDist: 0
+  force: 0
 --- !u!1 &7160292421917157450
 GameObject:
   m_ObjectHideFlags: 0
@@ -1350,6 +1598,10 @@ Transform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
+  - {fileID: 2134517333}
+  - {fileID: 2034951220}
+  - {fileID: 2086183258}
+  - {fileID: 1636256663}
   - {fileID: 1223853289183015899}
   - {fileID: 7558785777204778374}
   - {fileID: 3779182265360600927}
@@ -1369,7 +1621,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 7411533250134105649}
-  m_RootOrder: 1
+  m_RootOrder: 5
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!23 &8527899944241565020
 MeshRenderer:
@@ -1424,7 +1676,7 @@ Transform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children: []
   m_Father: {fileID: 7411533250134105649}
-  m_RootOrder: 3
+  m_RootOrder: 7
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!4 &9051432258879861050
 Transform:

+ 1 - 2
Assets/Scripts/CarController.cs

@@ -18,8 +18,7 @@ public class CarController : MonoBehaviour
     }
 
     // Update is called once per frame
-    void Update()
+    void FixedUpdate()
     {
-        
     }
 }

+ 51 - 61
Assets/Scripts/Wheel.cs

@@ -4,92 +4,82 @@ using UnityEngine;
 
 public class Wheel : MonoBehaviour
 {
-    public float radius =0.35f;
-    public float defaultPosition;
-    public float springConstant =1f;
-    public ForceMode springForceMode;
+    public Transform suspensionJoint;
+    public float radius = 0.35f;
+    public float restPosition;
+    public float restPositionOffset;
+    public float springConstant = 1f;
+    public float dampningFactor = 1f;
+    public float velocity;
+    // public ForceMode springForceMode;
     public float displacementRange = 0.1f;
-    public float dampningSpeed =0.1f;
-    public float hitPoint=0;
-    public float curDisplacement => defaultPosition- transform.localPosition.y;
-    public float minDisplacement => defaultPosition + displacementRange;
-    public float maxDisplacement => defaultPosition - displacementRange; 
+    public float hitPoint = 0;
+    public float CurDisplacement;
+    public float curDisplacement => restPosition - transform.localPosition.y;
+    public float topMaxDisplacement => restPosition + displacementRange;
+    public float botMaxDisplacement => restPosition - displacementRange;
     LayerMask groundMask;
 
     public CarController myCar;
-    
+
     void Awake()
     {
-        defaultPosition=transform.localPosition.y;
+        restPosition = transform.localPosition.y;
+        // restPositionOffset = suspensionJoint.position.y - transform.position.y;
         groundMask = LayerMask.GetMask("Ground");
     }
-
+    public float rayDist ;
     // Update is called once per frame
     void FixedUpdate()
     {
-        if(myCar==null){return;}
+        if (myCar == null) { return; }
 
         RaycastHit hit = new RaycastHit();
         float newDisplacement = transform.localPosition.y;
         float bottomEnd = transform.position.y - radius;
-        // hitPoint=0;
-        bool grounded=false;
+        Vector3 topEnd = transform.position + new Vector3(0, radius, 0);
 
-        // if(Physics.Linecast(transform.position+new Vector3(0,0,-0.1f), new Vector3(transform.position.x,bottomEnd,transform.position.z-0.1f), out hit, groundMask)){
-        //     Debug.DrawLine(transform.position, hit.point, Color.red);
-            
-        //     hitPoint=hit.point.y;
-        //     grounded=true;
-        // }
-        if(Physics.Linecast(transform.position, new Vector3(transform.position.x,bottomEnd,transform.position.z), out hit, groundMask)){
-            Debug.DrawLine(transform.position, hit.point, Color.red);
-            // if(hit.point.y > hitPoint){
-                hitPoint=hit.point.y;
-            // }
-            
-            grounded=true;
+        bool grounded = false;
+        if (Physics.Linecast(suspensionJoint.position, suspensionJoint.position - new Vector3(0,((radius*2)+(displacementRange))), out hit, groundMask))
+        {
+            Debug.DrawLine(suspensionJoint.position, hit.point, Color.red);
+            hitPoint = hit.point.y;
+            transform.position = new Vector3(suspensionJoint.position.x, hitPoint + (radius), suspensionJoint.position.z);
+            rayDist = suspensionJoint.position.y - hitPoint;
+            CurDisplacement = restPositionOffset - rayDist;
+            velocity = Vector3.Dot(transform.up, myCar.rb.GetPointVelocity(transform.position));
+            force = (CurDisplacement * springConstant) - (velocity * dampningFactor);
+            myCar.rb.AddForceAtPosition(Vector3.up * force, transform.position);
+            grounded = true;
         }
-        // if(Physics.Linecast(transform.position+new Vector3(0,0,0.1f), new Vector3(transform.position.x,bottomEnd,transform.position.z+0.1f), out hit, groundMask)){
-        //     Debug.DrawLine(transform.position, hit.point, Color.red);
-        //     if(hit.point.y > hitPoint){
-        //         hitPoint=hit.point.y;
-        //     }
-            
-        //     grounded=true;
-        // }
-        
-        if(!grounded){
-            newDisplacement = maxDisplacement;
-            Debug.Log("Not Touching ground ");
-        }else{
-            newDisplacement=hitPoint+radius;
+        else
+        {
+            // transform.localPosition = Vector3.Lerp(transform.position, 
+            // new Vector3(transform.localPosition.x, botMaxDisplacement, transform.localPosition.z),0.2f);
         }
 
-        transform.position = Vector3.Lerp(transform.position, new Vector3(transform.position.x,newDisplacement, transform.position.z),dampningSpeed);
-        if(curDisplacement < 0){
-            //Apply upforce
-        }
-            myCar.rb.AddForceAtPosition(-Physics.gravity*springConstant,transform.position,springForceMode);
-
+        // transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y + velocity, transform.localPosition.z);        
     }
-
-    void OnDrawGizmos() {
+    public float force;
+    void OnDrawGizmos()
+    {
         Gizmos.color = Color.green;
-        
+
         int segmants = 12;
 
-        Vector3 lastPoint= Vector3.zero;
-        for(int i=0; i< segmants;i++){
-            float theta = ((Mathf.PI*2)/segmants) * i;
-            float z= transform.position.z + (radius * Mathf.Sin(theta));
-            float y= transform.position.y +(radius * Mathf.Cos(theta));
-            Vector3 thisPoint = new Vector3(transform.position.x,y,z);
-            
-            
-            if(i>0){Gizmos.DrawLine(lastPoint,thisPoint);}
+        Vector3 lastPoint = Vector3.zero;
+        for (int i = 0; i < segmants; i++)
+        {
+            float theta = ((Mathf.PI * 2) / segmants) * i;
+            float z = transform.position.z + (radius * Mathf.Sin(theta));
+            float y = transform.position.y + (radius * Mathf.Cos(theta));
+            Vector3 thisPoint = new Vector3(transform.position.x, y, z);
+
+
+            if (i > 0) { Gizmos.DrawLine(lastPoint, thisPoint); }
             lastPoint = thisPoint;
         }
 
-        Gizmos.DrawWireSphere(new Vector3(transform.position.x,hitPoint,transform.position.z),0.2f);
+        Gizmos.DrawWireSphere(new Vector3(transform.position.x, hitPoint, transform.position.z), 0.2f);
     }
 }

+ 3 - 3
Packages/manifest.json

@@ -1,8 +1,8 @@
 {
   "dependencies": {
-    "com.unity.collab-proxy": "1.15.13",
-    "com.unity.ide.rider": "2.0.7",
-    "com.unity.ide.visualstudio": "2.0.14",
+    "com.unity.collab-proxy": "1.17.2",
+    "com.unity.ide.rider": "3.0.15",
+    "com.unity.ide.visualstudio": "2.0.16",
     "com.unity.ide.vscode": "1.2.5",
     "com.unity.test-framework": "1.1.31",
     "com.unity.textmeshpro": "3.0.6",

+ 4 - 4
Packages/packages-lock.json

@@ -1,7 +1,7 @@
 {
   "dependencies": {
     "com.unity.collab-proxy": {
-      "version": "1.15.13",
+      "version": "1.17.2",
       "depth": 0,
       "source": "registry",
       "dependencies": {
@@ -17,16 +17,16 @@
       "url": "https://packages.unity.com"
     },
     "com.unity.ide.rider": {
-      "version": "2.0.7",
+      "version": "3.0.15",
       "depth": 0,
       "source": "registry",
       "dependencies": {
-        "com.unity.test-framework": "1.1.1"
+        "com.unity.ext.nunit": "1.0.6"
       },
       "url": "https://packages.unity.com"
     },
     "com.unity.ide.visualstudio": {
-      "version": "2.0.14",
+      "version": "2.0.16",
       "depth": 0,
       "source": "registry",
       "dependencies": {

+ 2 - 2
ProjectSettings/ProjectVersion.txt

@@ -1,2 +1,2 @@
-m_EditorVersion: 2020.3.32f1
-m_EditorVersionWithRevision: 2020.3.32f1 (12f8b0834f07)
+m_EditorVersion: 2020.3.40f1
+m_EditorVersionWithRevision: 2020.3.40f1 (ba48d4efcef1)