Friction_sur_les_murs

This commit is contained in:
Djalim Simaila 2023-04-05 16:21:11 +02:00 committed by Solène
parent 027b59712c
commit f67e37a769
5 changed files with 225 additions and 66 deletions

View File

@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!62 &6200000
PhysicsMaterial2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Physics Material 2D
friction: 0
bounciness: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 05437948b085fe04db858fb222cff260
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 6200000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -811,7 +811,7 @@ Rigidbody2D:
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 3
m_Material: {fileID: 0}
m_Material: {fileID: 6200000, guid: 05437948b085fe04db858fb222cff260, type: 2}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 1
@ -873,7 +873,7 @@ MonoBehaviour:
dashLimit: 2
currentDash: 0
jumpForce: 20
horizontalDashingPower: 24
horizontalDashingPower: 30
verticalDashingPower: 12
dashingTime: 0.5
dashingCooldown: 0.5
@ -973,7 +973,7 @@ TrailRenderer:
outWeight: 0.33333334
- serializedVersion: 3
time: 0.7544602
value: 0.1340996
value: 0.27896655
inSlope: 0
outSlope: 0
tangentMode: 0
@ -986,17 +986,17 @@ TrailRenderer:
colorGradient:
serializedVersion: 2
key0: {r: 1, g: 0, b: 0, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key1: {r: 1, g: 0.72813684, b: 0.72813684, a: 1}
key2: {r: 1, g: 0.94411767, b: 0.94411767, a: 0}
key3: {r: 1, g: 1, b: 1, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime1: 45489
ctime2: 58982
ctime3: 65535
ctime4: 0
ctime5: 0
ctime6: 0
@ -1010,7 +1010,7 @@ TrailRenderer:
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumColorKeys: 4
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
@ -1074,6 +1074,7 @@ Transform:
m_Children:
- {fileID: 353210774}
- {fileID: 2090217972}
- {fileID: 1106389000}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1217,6 +1218,139 @@ Transform:
m_Father: {fileID: 2062960318}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1106388999
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1106389000}
- component: {fileID: 1106389003}
- component: {fileID: 1106389002}
- component: {fileID: 1106389001}
m_Layer: 0
m_Name: Ladders_de_droite_test (1)
m_TagString: Ladders
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1106389000
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1106388999}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 25.32, y: -2.04, z: 0.07268618}
m_LocalScale: {x: 2.414257, y: 28.932117, z: 2.4867253}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 734140129}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1106389001
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1106388999}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, 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: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.4, y: 0.41}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 0
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!50 &1106389002
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1106388999}
m_BodyType: 2
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!61 &1106389003
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1106388999}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.0071430504, y: 0.06687988}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 0.4, y: 0.41}
newSize: {x: 0.4, y: 0.41}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 0.42379636, y: 0.5451548}
m_EdgeRadius: 0
--- !u!1 &1339057963
GameObject:
m_ObjectHideFlags: 0
@ -37760,9 +37894,9 @@ RectTransform:
m_Father: {fileID: 1771634876}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 502, y: 0}
m_SizeDelta: {x: 500, y: 50}
m_Pivot: {x: 1, y: 1}
--- !u!114 &2115811658

View File

@ -19,6 +19,9 @@ TODO
- MAYBE mettre une stamina uniquement sur le Climb
- Collectibles
- Se faire poursuivre par le chien, si il nous touche, on dead
-Quand tu cours, rajouter une velocité de force moins forte pour pas qu'il y ai l'ajout de force sur les pentes
*/
@ -167,9 +170,12 @@ public class Player : MonoBehaviour
Vector2 horizontalVelocity = new Vector2(horizontalValue * speedModifer * Time.fixedDeltaTime, rb.velocity.y);
Vector2 verticalVelocity = new Vector2(rb.velocity.x, verticalValue * speedModifer * Time.fixedDeltaTime);
Vector2 targetVelocity = new Vector2();
if (isClimbing){
if (isClimbing)
{
targetVelocity += verticalVelocity;
}
targetVelocity += horizontalVelocity;
rb.velocity = Vector2.SmoothDamp(rb.velocity, targetVelocity, ref ref_velocity, 0.05f);
}

View File

@ -19,7 +19,7 @@ MonoBehaviour:
width: 2560
height: 997
m_ShowMode: 4
m_Title: Project
m_Title: Game
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 350}
m_MaxSize: {x: 10000, y: 10000}
@ -119,7 +119,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 300}
m_MaxSize: {x: 24288, y: 24288}
vertical: 0
controlID: 83
controlID: 108
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@ -139,12 +139,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1997
width: 1996
height: 947
m_MinSize: {x: 200, y: 300}
m_MaxSize: {x: 16192, y: 24288}
vertical: 1
controlID: 84
controlID: 49
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@ -164,12 +164,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1997
width: 1996
height: 655
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 0
controlID: 85
controlID: 50
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@ -189,12 +189,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 214
width: 389
height: 655
m_MinSize: {x: 100, y: 200}
m_MaxSize: {x: 8096, y: 16192}
vertical: 1
controlID: 61
controlID: 26
--- !u!114 &9
MonoBehaviour:
m_ObjectHideFlags: 52
@ -212,7 +212,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 214
width: 389
height: 436
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
@ -240,7 +240,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 436
width: 214
width: 389
height: 219
m_MinSize: {x: 101, y: 121}
m_MaxSize: {x: 4001, y: 4021}
@ -259,23 +259,23 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: SceneView
m_Name: GameView
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 214
x: 389
y: 0
width: 1783
width: 1607
height: 655
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 18}
m_ActualView: {fileID: 19}
m_Panes:
- {fileID: 18}
- {fileID: 19}
m_Selected: 0
m_LastSelected: 1
m_Selected: 1
m_LastSelected: 0
--- !u!114 &12
MonoBehaviour:
m_ObjectHideFlags: 52
@ -286,23 +286,23 @@ MonoBehaviour:
m_Enabled: 1
m_EditorHideFlags: 1
m_Script: {fileID: 12006, guid: 0000000000000000e000000000000000, type: 0}
m_Name: ProjectBrowser
m_Name: ConsoleWindow
m_EditorClassIdentifier:
m_Children: []
m_Position:
serializedVersion: 2
x: 0
y: 655
width: 1997
width: 1996
height: 292
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 20}
m_MinSize: {x: 101, y: 121}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 21}
m_Panes:
- {fileID: 20}
- {fileID: 21}
m_Selected: 0
m_LastSelected: 1
m_Selected: 1
m_LastSelected: 0
--- !u!114 &13
MonoBehaviour:
m_ObjectHideFlags: 52
@ -318,9 +318,9 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1997
x: 1996
y: 0
width: 563
width: 564
height: 947
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
@ -351,7 +351,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 509
width: 213
width: 388
height: 198
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -359,7 +359,7 @@ MonoBehaviour:
m_SaveData: []
m_LockTracker:
m_IsLocked: 0
m_LastSelectedObjectID: 40314
m_LastSelectedObjectID: 24496
--- !u!114 &15
MonoBehaviour:
m_ObjectHideFlags: 52
@ -382,7 +382,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73
width: 213
width: 388
height: 415
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -391,7 +391,7 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: fe180000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 2afbffff
m_RenameOverlay:
@ -439,7 +439,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73
width: 981
width: 1151
height: 415
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -478,7 +478,7 @@ MonoBehaviour:
m_MiniTool: 0
m_LockTracker:
m_IsLocked: 0
m_CurrentEditor: 1
m_CurrentEditor: 0
m_LayerEditor:
m_SelectedLayerIndex: 0
--- !u!114 &17
@ -536,9 +536,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 214
x: 389
y: 73
width: 1781
width: 1605
height: 634
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -763,9 +763,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: 18.536358, y: 9.103741, z: -9.385556}
m_Target: {x: 34.58273, y: 17.40244, z: -0.031249246}
speed: 2
m_Value: {x: 18.536358, y: 9.103741, z: -9.385556}
m_Value: {x: 34.58273, y: 17.40244, z: -0.031249246}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@ -816,9 +816,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 23.709541
m_Target: 11.2386
speed: 2
m_Value: 23.709541
m_Value: 11.2386
m_Ortho:
m_Target: 1
speed: 2
@ -863,9 +863,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 214
x: 389
y: 73
width: 1781
width: 1605
height: 634
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -904,7 +904,7 @@ MonoBehaviour:
m_HSlider: 0
m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 0
m_EnableMouseInput: 1
m_EnableSliderZoomHorizontal: 0
m_EnableSliderZoomVertical: 0
m_UniformScale: 1
@ -913,23 +913,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 1781
width: 1605
height: 613
m_Scale: {x: 1, y: 1}
m_Translation: {x: 890.5, y: 306.5}
m_Translation: {x: 802.5, y: 306.5}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -890.5
x: -802.5
y: -306.5
width: 1781
width: 1605
height: 613
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 1781, y: 634}
m_LastWindowPixelSize: {x: 1605, y: 634}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@ -957,7 +957,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 728
width: 1996
width: 1995
height: 271
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -991,7 +991,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 25}
m_SelectedIDs: c6620000
m_LastClickedID: 25286
m_ExpandedIDs: 00000000ba620000bc620000be62000000ca9a3b
m_ExpandedIDs: 00000000c6620000c8620000ca620000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1019,7 +1019,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000ba620000bc620000be620000
m_ExpandedIDs: 00000000c6620000c8620000ca620000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@ -1063,7 +1063,7 @@ MonoBehaviour:
m_IsRenaming: 0
m_OriginalEventType: 11
m_IsRenamingFilename: 1
m_ClientGUIView: {fileID: 12}
m_ClientGUIView: {fileID: 11}
m_CreateAssetUtility:
m_EndAction: {fileID: 0}
m_InstanceID: 0
@ -1097,7 +1097,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 728
width: 1901
width: 1995
height: 271
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
@ -1123,9 +1123,9 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1997
x: 1996
y: 73
width: 562
width: 563
height: 926
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas: