Add ceiling rotation drag and refine ground/wall pose offset controls

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-06-26 19:34:51 +02:00
1 parent 080b2a1c39
commit f652cdeca0
6 files changed
+407 -203

No files matched your search

+149 -41
View File
@@ -706,6 +706,66 @@ MonoBehaviour:
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 24
m_Metrics:
m_Width: 153.29688
m_Height: 219.59375
m_HorizontalBearingX: 9.296875
m_HorizontalBearingY: 216
m_HorizontalAdvance: 178.20312
m_GlyphRect:
m_X: 1270
m_Y: 763
m_Width: 154
m_Height: 220
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 18
m_Metrics:
m_Width: 149.39062
m_Height: 219.59375
m_HorizontalBearingX: 14.703125
m_HorizontalBearingY: 216
m_HorizontalAdvance: 178.20312
m_GlyphRect:
m_X: 656
m_Y: 751
m_Width: 151
m_Height: 220
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 22
m_Metrics:
m_Width: 148.79688
m_Height: 216.29688
m_HorizontalBearingX: 22.203125
m_HorizontalBearingY: 212.70312
m_HorizontalAdvance: 178.20312
m_GlyphRect:
m_X: 1026
m_Y: 895
m_Width: 149
m_Height: 217
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
- m_Index: 21
m_Metrics:
m_Width: 153.29688
m_Height: 219.59375
m_HorizontalBearingX: 13.796875
m_HorizontalBearingY: 216
m_HorizontalAdvance: 178.20312
m_GlyphRect:
m_X: 836
m_Y: 900
m_Width: 155
m_Height: 220
m_Scale: 1
m_AtlasIndex: 0
m_ClassDefinitionType: 0
m_CharacterTable:
- m_ElementType: 1
m_Unicode: 8230
@@ -879,6 +939,22 @@ MonoBehaviour:
m_Unicode: 73
m_GlyphIndex: 40
m_Scale: 1
- m_ElementType: 1
m_Unicode: 57
m_GlyphIndex: 24
m_Scale: 1
- m_ElementType: 1
m_Unicode: 51
m_GlyphIndex: 18
m_Scale: 1
- m_ElementType: 1
m_Unicode: 55
m_GlyphIndex: 22
m_Scale: 1
- m_ElementType: 1
m_Unicode: 54
m_GlyphIndex: 21
m_Scale: 1
m_AtlasTextures:
- {fileID: 2664084111089754775}
m_AtlasTextureIndex: 0
@@ -1058,6 +1134,22 @@ MonoBehaviour:
m_Y: 192
m_Width: 74
m_Height: 252
- m_X: 1255
m_Y: 748
m_Width: 183
m_Height: 249
- m_X: 641
m_Y: 736
m_Width: 180
m_Height: 249
- m_X: 1011
m_Y: 880
m_Width: 178
m_Height: 246
- m_X: 821
m_Y: 885
m_Width: 184
m_Height: 249
m_FreeGlyphRects:
- m_X: 189
m_Y: 74
@@ -1103,10 +1195,6 @@ MonoBehaviour:
m_Y: 1139
m_Width: 2047
m_Height: 908
- m_X: 229
m_Y: 944
m_Width: 1818
m_Height: 1103
- m_X: 103
m_Y: 864
m_Width: 214
@@ -1151,14 +1239,6 @@ MonoBehaviour:
m_Y: 500
m_Width: 48
m_Height: 136
- m_X: 498
m_Y: 940
m_Width: 1549
m_Height: 1107
- m_X: 498
m_Y: 888
m_Width: 1288
m_Height: 1159
- m_X: 1982
m_Y: 696
m_Width: 65
@@ -1175,38 +1255,10 @@ MonoBehaviour:
m_Y: 558
m_Width: 123
m_Height: 70
- m_X: 1255
m_Y: 628
m_Width: 97
m_Height: 1419
- m_X: 1255
m_Y: 748
m_Width: 291
m_Height: 1299
- m_X: 822
m_Y: 490
m_Width: 17
m_Height: 143
- m_X: 641
m_Y: 736
m_Width: 181
m_Height: 1311
- m_X: 1011
m_Y: 633
m_Width: 9
m_Height: 1414
- m_X: 498
m_Y: 885
m_Width: 1048
m_Height: 1162
- m_X: 1011
m_Y: 880
m_Width: 535
m_Height: 1167
- m_X: 498
m_Y: 754
m_Width: 324
m_Height: 1293
- m_X: 1965
m_Y: 0
m_Width: 82
@@ -1215,6 +1267,62 @@ MonoBehaviour:
m_Y: 0
m_Width: 34
m_Height: 444
- m_X: 1438
m_Y: 940
m_Width: 609
m_Height: 1107
- m_X: 1438
m_Y: 888
m_Width: 348
m_Height: 1159
- m_X: 1255
m_Y: 628
m_Width: 97
m_Height: 120
- m_X: 1438
m_Y: 748
m_Width: 108
m_Height: 1299
- m_X: 498
m_Y: 754
m_Width: 143
m_Height: 1293
- m_X: 229
m_Y: 944
m_Width: 412
m_Height: 1103
- m_X: 1011
m_Y: 633
m_Width: 9
m_Height: 247
- m_X: 1189
m_Y: 997
m_Width: 858
m_Height: 1050
- m_X: 1189
m_Y: 880
m_Width: 66
m_Height: 1167
- m_X: 821
m_Y: 736
m_Width: 1
m_Height: 149
- m_X: 229
m_Y: 1134
m_Width: 1818
m_Height: 913
- m_X: 1005
m_Y: 1126
m_Width: 1042
m_Height: 921
- m_X: 229
m_Y: 985
m_Width: 592
m_Height: 1062
- m_X: 1005
m_Y: 885
m_Width: 6
m_Height: 1162
m_FontFeatureTable:
m_MultipleSubstitutionRecords: []
m_LigatureSubstitutionRecords:
@@ -13852,7 +13960,7 @@ Texture2D:
m_ColorSpace: 1
m_PlatformBlob:
image data: 4194304
_typelessdata: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204050506070809090807060505040301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103040505060708090908070605050402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020405050607080909080706050504030100000000000000000000000000000000000000000000000000000000000000000000000000000003050607080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808Line truncated
_typelessdata: 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204050506070809090807060505040301000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000103040505060708090908070605050402000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020405050607080909080706050504030100000000000000000000000000000000000000000000000000000000000000000000000000000003050607080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808080808Line truncated
m_StreamData:
serializedVersion: 2
offset: 0
Binary file not shown.
+1 -1
View File
@@ -18,4 +18,4 @@ MonoBehaviour:
walkClipSpeed: 1
runClip: {fileID: 0}
runClipSpeed: 1
ceilingYOffset: 1
ceilingYOffset: 0.84
+133 -119
View File
@@ -352,7 +352,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 172071430}
serializedVersion: 2
m_LocalRotation: {x: 0.1305262, y: 5.7946933e-12, z: -2.6404215e-12, w: 0.9914449}
m_LocalRotation: {x: 0.13052616, y: 0.000000029547364, z: -0.000000003889983, w: 0.9914449}
m_LocalPosition: {x: 0, y: 1.9146858, z: -4.3466663}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -754,6 +754,118 @@ Transform:
m_Children: []
m_Father: {fileID: 347639557}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &286369291
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 286369292}
- component: {fileID: 286369295}
- component: {fileID: 286369294}
- component: {fileID: 286369293}
m_Layer: 0
m_Name: Ground
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!4 &286369292
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 286369291}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.5, z: 11.5}
m_LocalScale: {x: 50, y: 1, z: 50}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 686187287}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &286369293
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 286369291}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 3
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &286369294
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 286369291}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
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_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &286369295
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 286369291}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
@@ -841,7 +953,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
serializedVersion: 2
m_LocalRotation: {x: 0.1305262, y: 5.543152e-12, z: -7.2976987e-13, w: 0.9914449}
m_LocalRotation: {x: 0.13052616, y: 0.000000029547365, z: -0.000000003889983, w: 0.9914449}
m_LocalPosition: {x: 0, y: 1.9146858, z: -4.3466663}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
@@ -1492,7 +1604,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 721670973}
- {fileID: 286369292}
- {fileID: 963088882}
- {fileID: 1680244260}
- {fileID: 1981625995}
@@ -1598,119 +1710,6 @@ PhysicsMaterial:
m_Bounciness: 0
m_FrictionCombine: 0
m_BounceCombine: 0
--- !u!1 &721670969
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 721670973}
- component: {fileID: 721670972}
- component: {fileID: 721670971}
- component: {fileID: 721670970}
m_Layer: 0
m_Name: Plane
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 2147483647
m_IsActive: 1
--- !u!64 &721670970
MeshCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 721670969}
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 5
m_Convex: 0
m_CookingOptions: 30
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!23 &721670971
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 721670969}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_ForceMeshLod: -1
m_MeshLodSelectionBias: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
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_GlobalIlluminationMeshLod: 0
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_MaskInteraction: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &721670972
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 721670969}
m_Mesh: {fileID: 10209, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &721670973
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 721670969}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 11.5}
m_LocalScale: {x: 5, y: 5, z: 5}
m_ConstrainProportionsScale: 1
m_Children: []
m_Father: {fileID: 686187287}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &829281440
GameObject:
m_ObjectHideFlags: 0
@@ -2171,9 +2170,8 @@ MonoBehaviour:
deceleration: 45
cameraRelative: 1
cameraTransform: {fileID: 0}
runningParameter: Running
rotateTowardMovement: 1
rotationSpeed: 360
rotationSpeed: 540
jumpHeight: 1.2
gravity: -14.715
groundedStickVelocity: -2
@@ -2235,7 +2233,7 @@ MonoBehaviour:
m_EditorClassIdentifier: Assembly-CSharp::ConcealmentMeter
targetRenderer: {fileID: 0}
characterRoot: {fileID: 0}
voxelResolution: 24
voxelResolution: 48
environmentMask:
serializedVersion: 2
m_Bits: 4294967295
@@ -3210,6 +3208,22 @@ PrefabInstance:
propertyPath: m_ApplyRootMotion
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6701818411356282361, guid: c2044ff1352a6bb4586d6d04b59012b7, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6701818411356282361, guid: c2044ff1352a6bb4586d6d04b59012b7, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6701818411356282361, guid: c2044ff1352a6bb4586d6d04b59012b7, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6701818411356282361, guid: c2044ff1352a6bb4586d6d04b59012b7, type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
+107 -40
View File
@@ -23,6 +23,11 @@ using UnityEngine.InputSystem;
/// horizontal plane camera-relative (like on the ground). Jump (or reaching a ceiling edge)
/// lets go and drops.
///
/// On the ground the same mouse scheme fine-tunes a pose without moving the capsule: holding the
/// left mouse button and dragging up/down raises/lowers the visual mesh, holding the right mouse
/// button and dragging left/right turns the body. The raise eases back while walking and holds while
/// standing; the turn holds until movement re-aims the body. Both pause the camera orbit while held.
///
/// Named PlayerCharacterController to avoid a clash with Unity.VisualScripting's
/// example "PlayerController".
/// </summary>
@@ -32,10 +37,10 @@ public partial class PlayerCharacterController : MonoBehaviour
{
[Header("Movement")]
[Tooltip("Horizontal movement speed (units/second).")]
public float moveSpeed = 4f;
public float moveSpeed = 2f;
[Tooltip("Speed multiplier applied to ground movement and wall/ceiling climbing while the sprint key (Left Shift) is held.")]
public float sprintSpeedMultiplier = 1.8f;
public float sprintSpeedMultiplier = 3.2f;
[Tooltip("How quickly ground movement ramps up to the target speed (units/second²). Lower = more gradual start.")]
public float acceleration = 30f;
@@ -49,22 +54,19 @@ public partial class PlayerCharacterController : MonoBehaviour
[Tooltip("Camera used for camera-relative movement. Empty = Camera.main.")]
public Transform cameraTransform;
[Tooltip("Animator bool parameter driven true while running on the ground (false in air and while wall/ceiling-climbing).")]
public string runningParameter = "Running";
[Header("Rotation")]
[Tooltip("Smoothly turn the character to face its movement direction.")]
public bool rotateTowardMovement = true;
[Tooltip("Turn speed in degrees per second.")]
public float rotationSpeed = 720f;
public float rotationSpeed = 540f;
[Header("Jump & Gravity")]
[Tooltip("Peak jump height in units.")]
public float jumpHeight = 1.2f;
[Tooltip("Gravity in units per second squared (negative = downward).")]
public float gravity = -19.62f;
public float gravity = -14.715f;
[Tooltip("Small downward velocity kept while grounded for reliable ground contact.")]
public float groundedStickVelocity = -2f;
@@ -89,7 +91,7 @@ public partial class PlayerCharacterController : MonoBehaviour
[Tooltip("Minimum surface angle from 'up' (degrees) that counts as a climbable wall/ceiling rather than a slope.")]
[Range(50f, 180f)]
public float wallMinAngle = 80f;
public float wallMinAngle = 60f;
[Tooltip("How directly the move input must point into a wall to grab it (0 = any inward nudge, 1 = head-on only). Stops mere contact (e.g. standing at a wall's base) from grabbing.")]
[Range(0f, 1f)]
@@ -101,16 +103,16 @@ public partial class PlayerCharacterController : MonoBehaviour
[Tooltip("Speed multiplier for the mantle (pulling up over the top edge), independent of the climb speed. Multiplies moveSpeed; 1 = full walk speed, >1 = snappier pull-up.")]
[Min(0f)]
public float wallMantleSpeedMultiplier = 0.5f;
public float wallMantleSpeedMultiplier = 1.5f;
[Tooltip("Farthest the mesh can lean out from the wall via the mouse-drag offset (units).")]
public float wallMaxOffset = .2f;
public float wallMaxOffset = 0.1f;
[Tooltip("Farthest the mesh can sink INTO the wall via the mouse-drag offset (units). Only the visual model + its paint collider move; the CharacterController capsule stays put, so this isn't blocked by the wall collider.")]
public float wallMaxInset = .2f;
public float wallMaxInset = 0.2f;
[Tooltip("Units the lean-out offset changes per pixel of vertical mouse drag (left button held).")]
public float wallOffsetSensitivity = 0.01f;
public float wallOffsetSensitivity = 0.001f;
[Tooltip("Degrees the body turns per pixel of horizontal mouse drag (left button held) while climbing.")]
public float wallRotateSensitivity = 0.2f;
@@ -128,7 +130,7 @@ public partial class PlayerCharacterController : MonoBehaviour
public float ceilingGrabDistance = 0.3f;
[Tooltip("Upward hop when topping out over a wall/slope edge, so holding W carries you onto the ledge instead of dropping back onto the face and re-grabbing. In meters of jump height; 0 = no hop.")]
public float wallTopOutBoost = 1.2f;
public float wallTopOutBoost = 0.3f;
[Tooltip("Camera orbit input; paused while dragging the wall-climb offset. Auto-found if empty.")]
[SerializeField] private ThirdPersonOrbitInput cameraOrbit;
@@ -172,17 +174,25 @@ public partial class PlayerCharacterController : MonoBehaviour
/// </summary>
public bool AnimatorOverridden { get; set; }
/// <summary>
/// The visual-model transform moved by the wall-lean / ceiling offset; its localPosition is owned
/// solely by <see cref="SetMeshLean"/>. Exposed so <see cref="PlayerPoseController"/> can exclude it
/// from its per-frame rest reset — with the humanoid rig the Animator sits on this same node, so it
/// lands in the reset subtree and would otherwise be snapped back to base every frame, wiping the offset.
/// </summary>
public Transform MeshOffsetTarget => meshOffsetTarget;
// Below this horizontal speed (m/s, squared) the character counts as idle for the run animation.
private const float RunningSpeedThresholdSqr = 0.04f; // (0.2 m/s)^2
private CharacterController _controller;
private int _runningHash;
private float _verticalVelocity;
private Vector3 _horizontalVelocity; // smoothed horizontal move velocity (accel/decel ramp)
private bool _sprinting; // sprint key state this frame (exposed via IsSprinting)
private bool _isIdle; // snapshot: player essentially still this frame (exposed via IsIdle)
private bool _movingOnGround; // snapshot: grounded & moving above the run threshold (exposed via IsMovingOnGround)
private float _poseYOffset; // local-up model offset from the active pose (ceiling only); folded into SetMeshLean
private float _groundOffset; // signed vertical mesh raise from the ground mouse pose-adjust (+ up / - down); folded into SetMeshLean
// Ground contact normal from the latest Move (for slope sliding).
private Vector3 _groundNormal = Vector3.up;
@@ -219,7 +229,6 @@ public partial class PlayerCharacterController : MonoBehaviour
void Awake()
{
_controller = GetComponent<CharacterController>();
_runningHash = Animator.StringToHash(runningParameter);
if (!cameraTransform && Camera.main)
cameraTransform = Camera.main.transform;
if (!cameraOrbit)
@@ -318,10 +327,20 @@ public partial class PlayerCharacterController : MonoBehaviour
return;
}
// Ground pose-adjust (mouse): left button + vertical drag raises/lowers the mesh, right
// button + horizontal drag turns the body -- the wall scheme mirrored to the ground. Either
// pauses the camera orbit so the same drag isn't also spent orbiting. Gated to player control
// so it never fights painting (paint mode owns the left button).
bool groundYawDrag = false;
if (ControlEnabled)
groundYawDrag = HandleGroundPoseAdjust(h, v, Time.deltaTime);
else
_offsetDragging = false;
if (cameraOrbit)
cameraOrbit.LookSuppressed = false;
cameraOrbit.LookSuppressed = _offsetDragging;
// Glide the leftover wall lean back to the authored pose (set when leaving the wall).
// Glide the leftover wall lean home and re-apply the composed mesh offset (residual lean +
// ground raise + pose y-offset) in this frame's single write of meshOffsetTarget.
EaseMeshOffsetToRest(Time.deltaTime);
// A ground normal steeper than the slope limit is too steep to stand on
@@ -371,7 +390,8 @@ public partial class PlayerCharacterController : MonoBehaviour
if (!_groundNormalUpdated)
_groundNormal = Vector3.up;
if (rotateTowardMovement && moveDir.sqrMagnitude > 0.0001f)
// Face the movement direction, unless the right-button turn is actively steering the body.
if (rotateTowardMovement && !groundYawDrag && moveDir.sqrMagnitude > 0.0001f)
{
Quaternion target = Quaternion.LookRotation(moveDir, Vector3.up);
transform.rotation = Quaternion.RotateTowards(
@@ -431,6 +451,7 @@ public partial class PlayerCharacterController : MonoBehaviour
_verticalVelocity = 0f;
_slideSpeed = 0f;
_wallOffset = 0f;
_groundOffset = 0f; // drop any ground pose-adjust raise so it doesn't ride onto the wall
_meshOffsetResidual = 0f; // fresh grab: the climb path owns the mesh, drop any leftover ease
_wallYaw = 0f;
_wallStrafeSign = 0;
@@ -446,8 +467,9 @@ public partial class PlayerCharacterController : MonoBehaviour
/// <see cref="_wallOffset"/> (capsule stays put), and the right
/// mouse button + horizontal drag turns the body via <see cref="_wallYaw"/>. On a
/// CEILING: the body stays upright and moves WASD camera-relative in the horizontal plane
/// (like on the ground), facing the move direction; the lean-out drag pulls down off the
/// ceiling. Surface normal and gap are re-measured each frame; reaching a wall's top edge
/// (like on the ground), facing the move direction unless the right mouse button + horizontal
/// drag turns it; the lean-out drag pulls down off the ceiling. Surface normal and gap are
/// re-measured each frame; reaching a wall's top edge
/// mantles, climbing a wall up into an overhang hands off to the ceiling.
/// </summary>
private void ApplyWallClimbMovement(float h, float v, Vector3 moveDir, bool jumpPressed, bool sprinting, float dt)
@@ -565,9 +587,10 @@ public partial class PlayerCharacterController : MonoBehaviour
// Left button + vertical drag sets the lean offset (mouse up = out from the surface, mouse
// down = into it; the offset is signed and moves only the visual mesh, so it can sink into
// the wall where the capsule can't); right button + horizontal drag turns the body (wall
// only). The offset eases back to zero while moving and never detaches, the turn is held
// until leaving the wall. Either drag pauses the camera orbit.
// the wall where the capsule can't); right button + horizontal drag turns the body. The
// offset eases back to zero while moving and never detaches. On a WALL the turn is a held
// yaw offset from the wall normal (kept until leaving); on a CEILING the body is free like
// on the ground, so the drag rotates the transform directly. Either drag pauses the orbit.
bool offsetDrag = found && IsLeftMouseHeld();
bool yawDrag = found && IsRightMouseHeld();
if (offsetDrag || yawDrag)
@@ -577,7 +600,12 @@ public partial class PlayerCharacterController : MonoBehaviour
if (offsetDrag)
_wallOffset = Mathf.Clamp(_wallOffset - drag.y * wallOffsetSensitivity, -wallMaxInset, wallMaxOffset);
if (yawDrag)
_wallYaw += drag.x * wallRotateSensitivity;
{
if (onCeiling)
transform.Rotate(0f, drag.x * wallRotateSensitivity, 0f, Space.World);
else
_wallYaw += drag.x * wallRotateSensitivity;
}
}
if (!offsetDrag && hasMoveInput)
{
@@ -632,14 +660,18 @@ public partial class PlayerCharacterController : MonoBehaviour
{
if (onCeiling)
{
// Stay upright and face the horizontal move direction, like on the ground.
Vector3 dir = alongSurface;
dir.y = 0f;
if (dir.sqrMagnitude > 1e-4f)
// Stay upright and face the horizontal move direction, like on the ground -- unless
// the right-button turn is actively steering the body (then the manual yaw holds).
if (!yawDrag)
{
Quaternion target = Quaternion.LookRotation(dir.normalized, Vector3.up);
transform.rotation = Quaternion.RotateTowards(
transform.rotation, target, rotationSpeed * dt);
Vector3 dir = alongSurface;
dir.y = 0f;
if (dir.sqrMagnitude > 1e-4f)
{
Quaternion target = Quaternion.LookRotation(dir.normalized, Vector3.up);
transform.rotation = Quaternion.RotateTowards(
transform.rotation, target, rotationSpeed * dt);
}
}
}
else
@@ -651,9 +683,7 @@ public partial class PlayerCharacterController : MonoBehaviour
if (faceWall.sqrMagnitude > 0.0001f)
{
Vector3 dir = Quaternion.AngleAxis(_wallYaw, Vector3.up) * faceWall.normalized;
Quaternion target = Quaternion.LookRotation(dir, Vector3.up);
transform.rotation = Quaternion.RotateTowards(
transform.rotation, target, rotationSpeed * dt);
transform.rotation = Quaternion.LookRotation(dir, Vector3.up);
}
}
}
@@ -678,21 +708,58 @@ public partial class PlayerCharacterController : MonoBehaviour
Vector3 worldOffset = dir * offset;
meshOffsetTarget.localPosition = _meshBaseLocalPos
+ transform.InverseTransformVector(worldOffset)
+ Vector3.up * _poseYOffset; // active pose's ceiling y-offset (0 except while hanging on a ceiling)
+ Vector3.up * (_poseYOffset + _groundOffset); // ceiling pose y-offset + ground mouse raise (both 0 unless in use)
}
/// <summary>
/// Eases the leftover lean back to the authored pose after leaving the wall, so the model glides
/// home instead of snapping. Runs every non-climbing frame at the same rate as the in-climb
/// return; the direction is the wall normal latched at exit (a fresh grab clears the residual).
/// Re-applies the resting mesh offset every non-climbing frame in a single write of
/// <see cref="meshOffsetTarget"/>: eases the leftover wall lean back toward the authored pose
/// (latched exit normal) while composing in the ground mouse raise and any pose y-offset. Writing
/// unconditionally (even at rest) keeps this the sole owner of the offset transform, so a held
/// ground raise stays applied after the residual has reached zero. Offset 0 restores the pose.
/// </summary>
private void EaseMeshOffsetToRest(float dt)
{
if (_meshOffsetResidual == 0f) return;
_meshOffsetResidual = Mathf.MoveTowards(_meshOffsetResidual, 0f, wallOffsetReturnSpeed * dt);
if (_meshOffsetResidual != 0f)
_meshOffsetResidual = Mathf.MoveTowards(_meshOffsetResidual, 0f, wallOffsetReturnSpeed * dt);
SetMeshLean(_meshOffsetExitNormal, _meshOffsetResidual);
}
/// <summary>
/// Ground pose-adjust via the mouse, mirroring the wall-climb scheme: holding the LEFT button and
/// dragging up/down raises/lowers the visual mesh vertically (<see cref="_groundOffset"/>, capsule
/// untouched), holding the RIGHT button and dragging left/right turns the body (world-up yaw). The
/// raise eases back to the authored height while moving and holds while standing or dragging; the
/// turn persists until movement re-aims the body. Returns true while a right-button turn is active
/// so the caller skips auto-rotate-toward-movement that frame. Call site gates on ControlEnabled so
/// paint mode keeps the left button for painting.
/// </summary>
private bool HandleGroundPoseAdjust(float h, float v, float dt)
{
_offsetDragging = false;
bool offsetDrag = IsLeftMouseHeld();
bool yawDrag = IsRightMouseHeld();
bool hasMoveInput = (h * h + v * v) > 1e-4f;
if (offsetDrag || yawDrag)
{
_offsetDragging = true;
Vector2 drag = ReadMouseDelta();
if (offsetDrag)
_groundOffset = Mathf.Clamp(
_groundOffset + drag.y * wallOffsetSensitivity, -wallMaxInset, wallMaxOffset);
if (yawDrag)
transform.Rotate(0f, drag.x * wallRotateSensitivity, 0f, Space.World);
}
// The raise eases home only while actually moving; standing still holds it for posing.
if (!offsetDrag && hasMoveInput)
_groundOffset = Mathf.MoveTowards(_groundOffset, 0f, wallOffsetReturnSpeed * dt);
return yawDrag;
}
/// <summary>
/// Sets a local-up offset applied to the visual model only, composed into the wall-lean's single
/// write of <see cref="meshOffsetTarget"/>. Used by <see cref="PlayerPoseController"/> to hang a
+17 -2
View File
@@ -89,8 +89,9 @@ public partial class PlayerPoseController : MonoBehaviour
// evaluates. An AnimationClipPlayable only writes the bones its curves cover, so a clip that
// doesn't key a bone (an empty clip like the T-pose, or a partial one) would otherwise leave that
// bone frozen on the previous animation. Restoring this before each pose start makes every pose
// define the full body. meshOffsetTarget is an ancestor of the Animator, so it is never in this
// set and the controller's lean/ceiling offset stays untouched.
// define the full body. The controller's model-offset transform (meshOffsetTarget) is explicitly
// dropped from this set in CaptureRestPose — with the humanoid rig the Animator sits on that node,
// so it is the root of this subtree, and resetting it would wipe the wall-lean / ceiling offset.
private Transform[] _restBones;
private Vector3[] _restPos;
private Quaternion[] _restRot;
@@ -336,6 +337,20 @@ public partial class PlayerPoseController : MonoBehaviour
_restRot[i] = t.localRotation;
_restScale[i] = t.localScale;
}
// Drop the model-offset transform from the reset set so the per-frame ResetToRestPose never
// touches it: the wall-lean / ceiling offset (PlayerCharacterController.SetMeshLean) is its sole
// writer. With the humanoid rig the Animator shares this node, putting it in the captured subtree;
// resetting it each frame is exactly what was wiping the offsets. Nulling the slot makes
// ResetToRestPose's null-guard skip it. _player is resolved (and meshOffsetTarget too, since the
// controller's Awake runs first at its lower execution order) before this runs.
Transform offsetTarget = _player ? _player.MeshOffsetTarget : null;
if (offsetTarget)
{
int idx = System.Array.IndexOf(_restBones, offsetTarget);
if (idx >= 0)
_restBones[idx] = null;
}
}
/// <summary>Restores the captured rest pose so an empty or partial pose clip fully defines the body.</summary>