From ec1557ca70b81b526f7765e8a279b414fe1873a4 Mon Sep 17 00:00:00 2001 From: Malthbern <61102919+Malthbern@users.noreply.github.com> Date: Wed, 23 Jun 2021 23:14:08 -0500 Subject: [PATCH] Groundwork for wallrun kick laid groundwork to allow players to jump off walls cleaned up some dumb code --- TitanfallMovement.asset | 328 ++++++++++++++++++++-------------------- TitanfallMovement.cs | 74 +++++---- WallrunRaycast.cs | 6 +- 3 files changed, 208 insertions(+), 200 deletions(-) diff --git a/TitanfallMovement.asset b/TitanfallMovement.asset index 3014792..a3e397f 100644 --- a/TitanfallMovement.asset +++ b/TitanfallMovement.asset @@ -10,7 +10,7 @@ MonoBehaviour: m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: c333ccfdd0cbdbc4ca30cef2dd6e6b9b, type: 3} - m_Name: TitanfallDoubleJump + m_Name: TitanfallMovement m_EditorClassIdentifier: serializedUdonProgramAsset: {fileID: 11400000, guid: f42d75ce0b11dbc4a9b2559e76a8e23a, type: 2} @@ -48,7 +48,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: JumpCount + Data: CurrentV - Name: $v Entry: 7 Data: 2|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -60,7 +60,7 @@ MonoBehaviour: Data: 4|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Int32, mscorlib + Data: UnityEngine.Vector3, UnityEngine.CoreModule - Name: Entry: 8 Data: @@ -72,13 +72,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemInt32 + Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: JumpCount + Data: CurrentV - Name: symbolUniqueName Entry: 1 - Data: JumpCount + Data: CurrentV - Name: symbolDefaultValue Entry: 6 Data: @@ -111,7 +111,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: JumpTimeWaited + Data: JumpCount - Name: $v Entry: 7 Data: 6|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -123,7 +123,7 @@ MonoBehaviour: Data: 8|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Single, mscorlib + Data: System.Int32, mscorlib - Name: Entry: 8 Data: @@ -135,13 +135,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: SystemInt32 - Name: symbolOriginalName Entry: 1 - Data: JumpTimeWaited + Data: JumpCount - Name: symbolUniqueName Entry: 1 - Data: JumpTimeWaited + Data: JumpCount - Name: symbolDefaultValue Entry: 6 Data: @@ -174,7 +174,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: IDetection + Data: JumpTimeWaited - Name: $v Entry: 7 Data: 10|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -186,7 +186,7 @@ MonoBehaviour: Data: 12|System.RuntimeType, mscorlib - Name: Entry: 1 - Data: System.Boolean, mscorlib + Data: System.Single, mscorlib - Name: Entry: 8 Data: @@ -198,13 +198,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemBoolean + Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: IDetection + Data: JumpTimeWaited - Name: symbolUniqueName Entry: 1 - Data: IDetection + Data: JumpTimeWaited - Name: symbolDefaultValue Entry: 6 Data: @@ -237,7 +237,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: trueground + Data: IDetection - Name: $v Entry: 7 Data: 14|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -245,8 +245,14 @@ MonoBehaviour: Entry: 7 Data: 15|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType - Entry: 9 - Data: 12 + Entry: 7 + Data: 16|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.Boolean, mscorlib + - Name: + Entry: 8 + Data: - Name: declarationType Entry: 3 Data: 2 @@ -258,10 +264,10 @@ MonoBehaviour: Data: SystemBoolean - Name: symbolOriginalName Entry: 1 - Data: trueground + Data: IDetection - Name: symbolUniqueName Entry: 1 - Data: trueground + Data: IDetection - Name: symbolDefaultValue Entry: 6 Data: @@ -270,7 +276,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 16|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 17|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -294,31 +300,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: JumpsAllowed + Data: trueground - Name: $v Entry: 7 - Data: 17|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 18|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 18|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 19|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 4 + Data: 16 - Name: declarationType Entry: 3 - Data: 1 + Data: 2 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemInt32 + Data: SystemBoolean - Name: symbolOriginalName Entry: 1 - Data: JumpsAllowed + Data: trueground - Name: symbolUniqueName Entry: 1 - Data: JumpsAllowed + Data: trueground - Name: symbolDefaultValue Entry: 6 Data: @@ -327,7 +333,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 19|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 20|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -351,13 +357,13 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: JumpPower + Data: JumpsAllowed - Name: $v Entry: 7 - Data: 20|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 21|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 21|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 22|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 Data: 8 @@ -369,13 +375,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: SystemInt32 - Name: symbolOriginalName Entry: 1 - Data: JumpPower + Data: JumpsAllowed - Name: symbolUniqueName Entry: 1 - Data: JumpPower + Data: JumpsAllowed - Name: symbolDefaultValue Entry: 6 Data: @@ -384,7 +390,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 22|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 23|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -408,16 +414,16 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: JumpWaitTime + Data: JumpPower - Name: $v Entry: 7 - Data: 23|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 24|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 24|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 25|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 1 @@ -429,10 +435,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: JumpWaitTime + Data: JumpPower - Name: symbolUniqueName Entry: 1 - Data: JumpWaitTime + Data: JumpPower - Name: symbolDefaultValue Entry: 6 Data: @@ -441,7 +447,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 25|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 26|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -465,31 +471,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: isWallruning + Data: JumpWaitTime - Name: $v Entry: 7 - Data: 26|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 27|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 27|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 28|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 Data: 12 - Name: declarationType Entry: 3 - Data: 2 + Data: 1 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemBoolean + Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: isWallruning + Data: JumpWaitTime - Name: symbolUniqueName Entry: 1 - Data: isWallruning + Data: JumpWaitTime - Name: symbolDefaultValue Entry: 6 Data: @@ -498,7 +504,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 28|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 29|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -522,37 +528,31 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: WallDirection + Data: isWallruning - Name: $v Entry: 7 - Data: 29|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 30|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 30|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 31|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType - Entry: 7 - Data: 31|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: System.String, mscorlib - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 16 - Name: declarationType Entry: 3 - Data: 1 + Data: 2 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemString + Data: SystemBoolean - Name: symbolOriginalName Entry: 1 - Data: WallDirection + Data: isWallruning - Name: symbolUniqueName Entry: 1 - Data: WallDirection + Data: isWallruning - Name: symbolDefaultValue Entry: 6 Data: @@ -585,7 +585,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: HangPower + Data: HungTime - Name: $v Entry: 7 Data: 33|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -594,10 +594,10 @@ MonoBehaviour: Data: 34|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 - Data: 1 + Data: 2 - Name: syncMode Entry: 3 Data: 0 @@ -606,10 +606,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: HangPower + Data: HungTime - Name: symbolUniqueName Entry: 1 - Data: HangPower + Data: HungTime - Name: symbolDefaultValue Entry: 6 Data: @@ -642,7 +642,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: SavedV3 + Data: HangTimerUp - Name: $v Entry: 7 Data: 36|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -650,14 +650,8 @@ MonoBehaviour: Entry: 7 Data: 37|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType - Entry: 7 - Data: 38|System.RuntimeType, mscorlib - - Name: - Entry: 1 - Data: UnityEngine.Vector3, UnityEngine.CoreModule - - Name: - Entry: 8 - Data: + Entry: 9 + Data: 16 - Name: declarationType Entry: 3 Data: 2 @@ -666,13 +660,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: UnityEngineVector3 + Data: SystemBoolean - Name: symbolOriginalName Entry: 1 - Data: SavedV3 + Data: HangTimerUp - Name: symbolUniqueName Entry: 1 - Data: SavedV3 + Data: HangTimerUp - Name: symbolDefaultValue Entry: 6 Data: @@ -681,7 +675,7 @@ MonoBehaviour: Data: - Name: fieldAttributes Entry: 7 - Data: 39|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib + Data: 38|System.Collections.Generic.List`1[[System.Attribute, mscorlib]], mscorlib - Name: Entry: 12 Data: 0 @@ -705,31 +699,37 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerhead1 + Data: WallDirection - Name: $v Entry: 7 - Data: 40|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor + Data: 39|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor - Name: fieldSymbol Entry: 7 - Data: 41|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor + Data: 40|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType - Entry: 9 - Data: 38 + Entry: 7 + Data: 41|System.RuntimeType, mscorlib + - Name: + Entry: 1 + Data: System.String, mscorlib + - Name: + Entry: 8 + Data: - Name: declarationType Entry: 3 - Data: 2 + Data: 1 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: UnityEngineVector3 + Data: SystemString - Name: symbolOriginalName Entry: 1 - Data: playerhead1 + Data: WallDirection - Name: symbolUniqueName Entry: 1 - Data: playerhead1 + Data: WallDirection - Name: symbolDefaultValue Entry: 6 Data: @@ -762,7 +762,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerhead2 + Data: HangPower - Name: $v Entry: 7 Data: 43|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -771,22 +771,22 @@ MonoBehaviour: Data: 44|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 38 + Data: 12 - Name: declarationType Entry: 3 - Data: 2 + Data: 1 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: UnityEngineVector3 + Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: playerhead2 + Data: HangPower - Name: symbolUniqueName Entry: 1 - Data: playerhead2 + Data: HangPower - Name: symbolDefaultValue Entry: 6 Data: @@ -819,7 +819,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerroot1 + Data: Hangtime - Name: $v Entry: 7 Data: 46|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -828,22 +828,22 @@ MonoBehaviour: Data: 47|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 38 + Data: 12 - Name: declarationType Entry: 3 - Data: 2 + Data: 1 - Name: syncMode Entry: 3 Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: UnityEngineVector3 + Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: playerroot1 + Data: Hangtime - Name: symbolUniqueName Entry: 1 - Data: playerroot1 + Data: Hangtime - Name: symbolDefaultValue Entry: 6 Data: @@ -876,7 +876,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerroot2 + Data: SavedV3 - Name: $v Entry: 7 Data: 49|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -885,7 +885,7 @@ MonoBehaviour: Data: 50|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 38 + Data: 4 - Name: declarationType Entry: 3 Data: 2 @@ -897,10 +897,10 @@ MonoBehaviour: Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: playerroot2 + Data: SavedV3 - Name: symbolUniqueName Entry: 1 - Data: playerroot2 + Data: SavedV3 - Name: symbolDefaultValue Entry: 6 Data: @@ -933,7 +933,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerheight2 + Data: playerhead1 - Name: $v Entry: 7 Data: 52|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -942,7 +942,7 @@ MonoBehaviour: Data: 53|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 4 - Name: declarationType Entry: 3 Data: 2 @@ -951,13 +951,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: playerheight2 + Data: playerhead1 - Name: symbolUniqueName Entry: 1 - Data: playerheight2 + Data: playerhead1 - Name: symbolDefaultValue Entry: 6 Data: @@ -990,7 +990,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playerheightf + Data: playerhead2 - Name: $v Entry: 7 Data: 55|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -999,7 +999,7 @@ MonoBehaviour: Data: 56|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 4 - Name: declarationType Entry: 3 Data: 2 @@ -1008,13 +1008,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: playerheightf + Data: playerhead2 - Name: symbolUniqueName Entry: 1 - Data: playerheightf + Data: playerhead2 - Name: symbolDefaultValue Entry: 6 Data: @@ -1047,7 +1047,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: playercrouchf + Data: playerroot1 - Name: $v Entry: 7 Data: 58|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1056,7 +1056,7 @@ MonoBehaviour: Data: 59|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 4 - Name: declarationType Entry: 3 Data: 2 @@ -1065,13 +1065,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: playercrouchf + Data: playerroot1 - Name: symbolUniqueName Entry: 1 - Data: playercrouchf + Data: playerroot1 - Name: symbolDefaultValue Entry: 6 Data: @@ -1104,7 +1104,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: SlideTimeWaited + Data: playerroot2 - Name: $v Entry: 7 Data: 61|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1113,7 +1113,7 @@ MonoBehaviour: Data: 62|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 4 - Name: declarationType Entry: 3 Data: 2 @@ -1122,13 +1122,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: SystemSingle + Data: UnityEngineVector3 - Name: symbolOriginalName Entry: 1 - Data: SlideTimeWaited + Data: playerroot2 - Name: symbolUniqueName Entry: 1 - Data: SlideTimeWaited + Data: playerroot2 - Name: symbolDefaultValue Entry: 6 Data: @@ -1161,7 +1161,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: UpdateHeight + Data: playerheight2 - Name: $v Entry: 7 Data: 64|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1170,7 +1170,7 @@ MonoBehaviour: Data: 65|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1182,10 +1182,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: UpdateHeight + Data: playerheight2 - Name: symbolUniqueName Entry: 1 - Data: UpdateHeight + Data: playerheight2 - Name: symbolDefaultValue Entry: 6 Data: @@ -1218,7 +1218,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: SlideVSaveTime + Data: playerheightf - Name: $v Entry: 7 Data: 67|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1227,10 +1227,10 @@ MonoBehaviour: Data: 68|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 - Data: 1 + Data: 2 - Name: syncMode Entry: 3 Data: 0 @@ -1239,10 +1239,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: SlideVSaveTime + Data: playerheightf - Name: symbolUniqueName Entry: 1 - Data: SlideVSaveTime + Data: playerheightf - Name: symbolDefaultValue Entry: 6 Data: @@ -1275,7 +1275,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: CurrentV + Data: playercrouchf - Name: $v Entry: 7 Data: 70|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1284,7 +1284,7 @@ MonoBehaviour: Data: 71|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 38 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1293,13 +1293,13 @@ MonoBehaviour: Data: 0 - Name: symbolResolvedTypeName Entry: 1 - Data: UnityEngineVector3 + Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: CurrentV + Data: playercrouchf - Name: symbolUniqueName Entry: 1 - Data: CurrentV + Data: playercrouchf - Name: symbolDefaultValue Entry: 6 Data: @@ -1332,7 +1332,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: CVX + Data: SlideTimeWaited - Name: $v Entry: 7 Data: 73|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1341,7 +1341,7 @@ MonoBehaviour: Data: 74|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1353,10 +1353,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: CVX + Data: SlideTimeWaited - Name: symbolUniqueName Entry: 1 - Data: CVX + Data: SlideTimeWaited - Name: symbolDefaultValue Entry: 6 Data: @@ -1389,7 +1389,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: CVZ + Data: UpdateHeight - Name: $v Entry: 7 Data: 76|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1398,7 +1398,7 @@ MonoBehaviour: Data: 77|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1410,10 +1410,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: CVZ + Data: UpdateHeight - Name: symbolUniqueName Entry: 1 - Data: CVZ + Data: UpdateHeight - Name: symbolDefaultValue Entry: 6 Data: @@ -1446,7 +1446,7 @@ MonoBehaviour: Data: - Name: $k Entry: 1 - Data: CVY + Data: SlideVSaveTime - Name: $v Entry: 7 Data: 79|UdonSharp.Compiler.FieldDefinition, UdonSharp.Editor @@ -1455,10 +1455,10 @@ MonoBehaviour: Data: 80|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 - Data: 2 + Data: 1 - Name: syncMode Entry: 3 Data: 0 @@ -1467,10 +1467,10 @@ MonoBehaviour: Data: SystemSingle - Name: symbolOriginalName Entry: 1 - Data: CVY + Data: SlideVSaveTime - Name: symbolUniqueName Entry: 1 - Data: CVY + Data: SlideVSaveTime - Name: symbolDefaultValue Entry: 6 Data: @@ -1512,7 +1512,7 @@ MonoBehaviour: Data: 83|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 12 + Data: 16 - Name: declarationType Entry: 3 Data: 2 @@ -1569,7 +1569,7 @@ MonoBehaviour: Data: 86|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1626,7 +1626,7 @@ MonoBehaviour: Data: 89|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 2 @@ -1683,7 +1683,7 @@ MonoBehaviour: Data: 92|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 1 @@ -1740,7 +1740,7 @@ MonoBehaviour: Data: 95|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 1 @@ -1797,7 +1797,7 @@ MonoBehaviour: Data: 98|UdonSharp.Compiler.SymbolDefinition, UdonSharp.Editor - Name: internalType Entry: 9 - Data: 8 + Data: 12 - Name: declarationType Entry: 3 Data: 1 diff --git a/TitanfallMovement.cs b/TitanfallMovement.cs index 3fd84c6..2ac12d3 100644 --- a/TitanfallMovement.cs +++ b/TitanfallMovement.cs @@ -5,6 +5,10 @@ public class TitanfallMovement : UdonSharpBehaviour { + //common values + private Vector3 CurrentV; + + //Values For DJump private int JumpCount = 0; private float JumpTimeWaited = 0; @@ -13,15 +17,19 @@ public class TitanfallMovement : UdonSharpBehaviour public int JumpsAllowed = 2; public float JumpPower = 6; - public float JumpWaitTime = 0.5f; + public float JumpWaitTime = 0.35f; //vars for wallrun private bool isWallruning = false; + private float HungTime; + private bool HangTimerUp = false; public string WallDirection; public float HangPower = 0.3f; + public float Hangtime = 4.5f; + //currently unused @@ -40,10 +48,6 @@ public class TitanfallMovement : UdonSharpBehaviour public float SlideVSaveTime = 1.5f; //values for slide - private Vector3 CurrentV; - private float CVX; - private float CVZ; - private float CVY; private bool InSlide = false; private float slidespeedx; private float slidespeedz; @@ -66,11 +70,7 @@ void Update() //get velocity CurrentV = Networking.LocalPlayer.GetVelocity(); - CVX = CurrentV.x; - CVZ = CurrentV.z; - CVY = CurrentV.y; - - //a dumb way to allow for scripting custom events in the way i needed + //a dum way to allow for scripting custom events in the way i needed //in U# in a way U# allows for... i hate this UpdateDJump(); WallrunUpdate(); @@ -166,53 +166,61 @@ private void LateUpdateDJump() private void WallrunUpdate() { - //initate wallrun by detecting wall direction and appling a "wall stick and y = 0 force" - if (Networking.LocalPlayer.IsPlayerGrounded() == false && isWallruning == false) + //limiting how long a player can wallrun + if (isWallruning == true && HungTime <= Hangtime) + { + Debug.Log("han time tick"); + HungTime += Time.deltaTime; + } + else if (HungTime >= Hangtime && Networking.LocalPlayer.IsPlayerGrounded() == false) { + isWallruning = false; + HangTimerUp = true; + } + + //initate wallrun by detecting wall direction and appling a "slowed Y force" + if (Networking.LocalPlayer.IsPlayerGrounded() == false && isWallruning == false && HangTimerUp == false) + { + Debug.Log("can wallrun"); if (WallDirection == "Back") { Debug.Log("wall Direction is " + WallDirection); Networking.LocalPlayer.SetGravityStrength(HangPower); - Networking.LocalPlayer.SetVelocity(new Vector3(CVX, 2.2f, CVZ)); + Networking.LocalPlayer.SetVelocity(new Vector3(CurrentV.x, 2.2f,CurrentV.z)); isWallruning = true; } else if (WallDirection == "Right") { Debug.Log("wall Direction is " + WallDirection); Networking.LocalPlayer.SetGravityStrength(HangPower); - Networking.LocalPlayer.SetVelocity(new Vector3(CVX, 2.2f, CVZ)); + Networking.LocalPlayer.SetVelocity(new Vector3(CurrentV.x * 2, 2.2f, CurrentV.z)); isWallruning = true; } else if (WallDirection == "Left") { Debug.Log("wall Direction is " + WallDirection); Networking.LocalPlayer.SetGravityStrength(HangPower); - Networking.LocalPlayer.SetVelocity(new Vector3(CVX, CVY * 2.2f, CVZ)); + Networking.LocalPlayer.SetVelocity(new Vector3(CurrentV.x, CurrentV.y * 2.2f, CurrentV.z)); isWallruning = true; } else if (WallDirection == "Front") { Debug.Log("wall Direction is " + WallDirection); Networking.LocalPlayer.SetGravityStrength(HangPower); - Networking.LocalPlayer.SetVelocity(new Vector3(CVX, CVY * 2.2f, CVZ)); + Networking.LocalPlayer.SetVelocity(new Vector3(CurrentV.x, CurrentV.y * 2.2f, CurrentV.z)); isWallruning = true; } - else if (WallDirection == "NW") - { - Networking.LocalPlayer.SetGravityStrength(1f); - isWallruning = false; - } } - else + //reseting wallrun when you get away from the wall or touch the floor + else if (Networking.LocalPlayer.IsPlayerGrounded() == true || WallDirection == "NW") { - if (Networking.LocalPlayer.IsPlayerGrounded() == true) - { - WallDirection = null; - isWallruning = false; - Networking.LocalPlayer.SetGravityStrength(1f); - } + Debug.Log("finished Wallrun"); + HangTimerUp = false; + HungTime = 0; + WallDirection = null; + isWallruning = false; + Networking.LocalPlayer.SetGravityStrength(1f); } - } @@ -277,8 +285,8 @@ private void UpdateSlideHop() //slide speed math if (InSlide == false) { - slidespeedx = (CVX * SlideMultiplier); - slidespeedz = (CVZ * SlideMultiplier); + slidespeedx = (CurrentV.x * SlideMultiplier); + slidespeedz = (CurrentV.z * SlideMultiplier); } } private void LateUpdateSlideHop() @@ -292,9 +300,9 @@ private void LateUpdateSlideHop() } //logic for sliding - if (playerheightf < playercrouchf && trueground == true && Mathf.Abs(CVX) >= SlideBeginSpeed || Mathf.Abs(CVZ) >= SlideBeginSpeed) + if (playerheightf < playercrouchf && trueground == true && Mathf.Abs(CurrentV.x) >= SlideBeginSpeed || Mathf.Abs(CurrentV.z) >= SlideBeginSpeed) { - Networking.LocalPlayer.SetVelocity(new Vector3(slidespeedx, CVY, slidespeedz)); + Networking.LocalPlayer.SetVelocity(new Vector3(slidespeedx, CurrentV.y, slidespeedz)); InSlide = true; } else diff --git a/WallrunRaycast.cs b/WallrunRaycast.cs index 32cdb48..241fa47 100644 --- a/WallrunRaycast.cs +++ b/WallrunRaycast.cs @@ -31,17 +31,17 @@ void Update() Debug.Log("Back cast hit"); BaseTFScript.SetProgramVariable("WallDirection", "Back"); } - else if (Physics.Raycast(transform.position, transform.right, RaycastDistance, Bitmask)) + else if (Physics.Raycast(transform.position, transform.right, out raycast, RaycastDistance, Bitmask)) { Debug.Log("Right cast hit"); BaseTFScript.SetProgramVariable("WallDirection", "Right"); } - else if (Physics.Raycast(transform.position, (transform.right + LeftOffset), RaycastDistance, Bitmask)) + else if (Physics.Raycast(transform.position, (transform.right + LeftOffset), out raycast, RaycastDistance, Bitmask)) { Debug.Log("Left cast hit"); BaseTFScript.SetProgramVariable("WallDirection", "Left"); } - else if (Physics.Raycast(transform.position, Vector3.forward, RaycastDistance, Bitmask)) + else if (Physics.Raycast(transform.position, Vector3.forward, out raycast, RaycastDistance, Bitmask)) { Debug.Log("Front cast hit"); BaseTFScript.SetProgramVariable("WallDirection", "Front");