I Think i Fixed Everyting

This commit is contained in:
juliuse98
2021-11-11 20:26:03 +01:00
parent ea8394bd16
commit a31989b459
18 changed files with 2106 additions and 612 deletions

View File

@@ -0,0 +1,226 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &867143322194457524
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2213212323547960416}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2236875552107647873
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7502619830433694848}
m_Layer: 0
m_Name: Muzzle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7502619830433694848
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2236875552107647873}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.0004, y: -0.01487, z: -0.143}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 732033708985862910}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3709710254213546924
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 808197646603973991}
m_Layer: 0
m_Name: Left_Hand_REF
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &808197646603973991
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3709710254213546924}
m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0}
m_LocalPosition: {x: -0.03000002, y: -0.11399987, z: -0.42400002}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 732033708985862910}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0}
--- !u!1 &3884320679152247161
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5792494204646893847}
m_Layer: 0
m_Name: Right_Hand_REF
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5792494204646893847
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3884320679152247161}
m_LocalRotation: {x: -0, y: 0.7071068, z: 0.7071068, w: 0}
m_LocalPosition: {x: 0.030000005, y: -0.10400012, z: -0.42400002}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 732033708985862910}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0}
--- !u!1 &5071598280516985511
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 732033708985862910}
- component: {fileID: 6352645931139448055}
m_Layer: 0
m_Name: M92
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &732033708985862910
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5071598280516985511}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.03999999}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1584484548595912410}
- {fileID: 7502619830433694848}
- {fileID: 808197646603973991}
- {fileID: 5792494204646893847}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6352645931139448055
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5071598280516985511}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1330674258901920049
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 732033708985862910}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalPosition.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalPosition.y
value: -0.054000046
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalPosition.z
value: -0.334
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_Name
value: M92
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: daf332133edb41440a3abb1cf6e24558, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
--- !u!1 &2213212323547960416 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
m_PrefabInstance: {fileID: 1330674258901920049}
m_PrefabAsset: {fileID: 0}
--- !u!4 &1584484548595912410 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
m_PrefabInstance: {fileID: 1330674258901920049}
m_PrefabAsset: {fileID: 0}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bd217f9f85ce78e46a925776562625e8
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -119,13 +119,13 @@ MonoBehaviour:
runInBackground: 1
autoStartServerBuild: 1
serverTickRate: 30
offlineScene: Assets/Scenes/TestOfflineScene.unity
offlineScene: Assets/Scenes/TestScene.unity
onlineScene: Assets/Scenes/TestScene.unity
transport: {fileID: 3422988367618467037}
networkAddress: localhost
maxConnections: 100
authenticator: {fileID: 0}
playerPrefab: {fileID: 6272346181302961293, guid: 2935eead9a075fd489d6a6dc273a5999, type: 3}
playerPrefab: {fileID: 6272346181302961293, guid: a14d876ac00bdf6498e30b3e58b68fdf, type: 3}
autoCreatePlayer: 1
playerSpawnMethod: 0
spawnPrefabs: []

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 815ba91b9da92294f8041b56643e5e15
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -257,68 +257,6 @@ SphereCollider:
serializedVersion: 2
m_Radius: 0.5
m_Center: {x: 0, y: 0, z: 0}
--- !u!1 &1749713556945343754
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 9064841067161443684}
m_Layer: 0
m_Name: Right_Hand_REF
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &9064841067161443684
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1749713556945343754}
m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0.09, y: -0.05, z: 0.03}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4058555163434875561}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0}
--- !u!1 &2221492823855642591
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2781132594439880980}
m_Layer: 0
m_Name: Left_Hand_REF
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2781132594439880980
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2221492823855642591}
m_LocalRotation: {x: -0.5, y: 0.5, z: 0.5, w: 0.5}
m_LocalPosition: {x: 0.09, y: -0.06, z: -0.03}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4058555163434875561}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: -90, y: 90, z: 0}
--- !u!1 &2992488853448454767
GameObject:
m_ObjectHideFlags: 0
@@ -343,56 +281,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2992488853448454767}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.35}
m_LocalPosition: {x: 0, y: 0, z: 0.266}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6272346181657429396}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &3649358604728444914
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5021921342190399731}
m_Layer: 0
m_Name: Muzzle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5021921342190399731
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3649358604728444914}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.274, z: 0.7}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6272346181657429396}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2425026116520232903
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3682030003239559187}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &4824770690127859843
GameObject:
m_ObjectHideFlags: 0
@@ -576,20 +471,18 @@ GameObject:
- component: {fileID: 6272346181302961296}
- component: {fileID: 8191616764201741429}
- component: {fileID: 6272346181302961295}
- component: {fileID: 320375778840406984}
- component: {fileID: -4574526707603160507}
- component: {fileID: 7273209952621479910}
- component: {fileID: 4959463831902427506}
- component: {fileID: 3387435154213398635}
- component: {fileID: 5630859218361338035}
- component: {fileID: 8436279266335313624}
- component: {fileID: 268368477457052331}
- component: {fileID: 3781802212159559521}
- component: {fileID: 320375778840406984}
- component: {fileID: 7273209952621479910}
- component: {fileID: 6207632454083444980}
- component: {fileID: 1509131218531316230}
- component: {fileID: -7261721819113345487}
- component: {fileID: 8957579265169979397}
- component: {fileID: 3965891812990671158}
- component: {fileID: 4276885029697240453}
- component: {fileID: 7198056240135858432}
m_Layer: 0
m_Name: Player Animation Test
m_TagString: Player
@@ -649,23 +542,6 @@ CharacterController:
m_SkinWidth: 0.08
m_MinMoveDistance: 0.001
m_Center: {x: 0, y: 1, z: 0}
--- !u!114 &320375778840406984
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
serverOnly: 0
visible: 0
m_AssetId: a14d876ac00bdf6498e30b3e58b68fdf
hasSpawned: 0
--- !u!114 &-4574526707603160507
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -680,13 +556,13 @@ MonoBehaviour:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
ADSContoller: {fileID: 7198056240135858432}
walkSpeed: 6
sprintSpeed: 8
procedualAnimationController: {fileID: 3387435154213398635}
walkSpeed: 5
sprintSpeed: 7
aimWalkSpeed: 3
moveSmoothTime: 0.05
gravity: -10
jumpHeight: 1.2
jumpHeight: 1
inputDirection: {x: 0, y: 0, z: 0}
groundCheck: {fileID: 6272346182417644039}
groundMask:
@@ -696,7 +572,8 @@ MonoBehaviour:
moveGroundAngle: 0
isGrounded: 0
isSprinting: 0
--- !u!114 &7273209952621479910
velocity: {x: 0, y: 0, z: 0}
--- !u!114 &3387435154213398635
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@@ -705,42 +582,47 @@ MonoBehaviour:
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3}
m_Script: {fileID: 11500000, guid: 9bd09d0992070b049b461b56fd022956, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
clientAuthority: 1
sendInterval: 0.05
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 0
bufferTimeMultiplier: 1
bufferSizeLimit: 64
catchupThreshold: 4
catchupMultiplier: 0.1
showGizmos: 1
showOverlay: 1
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
--- !u!114 &4959463831902427506
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 00dc60b61b501f2419e2abd7158be5f8, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
color: {r: 1, g: 0, b: 0, a: 0}
renderer: {fileID: 0}
stepAmplitudeWalking: 0.02
stepAmplitudeSprinting: 0.07
stepFrequency: 0.3
playerController: {fileID: -4574526707603160507}
currentCameraRecoilX: 0
currentCameraRecoilY: 0
gun: {fileID: 3682030003239559187}
gunHolder: {fileID: 7768205653369755348}
positionRecoil: 1
rotationRecoil: 1
positionMultX: 2
positionMultY: 5
positionMultZ: 1
playerMouseLook: {fileID: 5630859218361338035}
cameraRecoilX: 10
cameraRecoilY: 10
rotX: 1
rotationMultX: 5
rotationOffsetX: 0.1
rotY: 1
rotationMultY: 0
rotZ: 0
rotationMultZ: 0
sideSwey: 1
sweyMultX: 1
sweyMultY: 0
sweyMultZ: 0
sweyWhileAim: 0.1
returnForce: 0.001
impulsForce: 0.01
maxRecoil: 0.1
aimSpeed: 0.06
aimVal: 0
AimPoint: {fileID: 2992488853448454767}
HoldPoint: {fileID: 8043317747957554736}
isAiming: 0
--- !u!114 &5630859218361338035
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -783,30 +665,6 @@ MonoBehaviour:
username:
usernameTextObj: {fileID: 0}
health: 0
--- !u!114 &268368477457052331
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4db7caf602ce379408a59c8722e06e46, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
playerController: {fileID: -4574526707603160507}
gunAnimation: {fileID: 4276885029697240453}
posCheckDistance: 1
checkDist: 0
stepAmplitudeWalking: 0.05
stepAmplitudeSprinting: 0.07
stepFrequency: 0.8
Neck: {fileID: 6272346181657429396}
gunRotation: {fileID: 0}
rotationMultiplier: 0.1
--- !u!114 &3781802212159559521
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -822,9 +680,55 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0.1
muzzle: {fileID: 3649358604728444914}
shootAnim: {fileID: 4276885029697240453}
shootAnim: {fileID: 3387435154213398635}
fireRate: 320
gunHoldPos: {fileID: 3682030003239559187}
--- !u!114 &320375778840406984
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9b91ecbcc199f4492b9a91e820070131, type: 3}
m_Name:
m_EditorClassIdentifier:
sceneId: 0
serverOnly: 0
visible: 0
m_AssetId: a14d876ac00bdf6498e30b3e58b68fdf
hasSpawned: 0
--- !u!114 &7273209952621479910
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2f74aedd71d9a4f55b3ce499326d45fb, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
clientAuthority: 1
sendInterval: 0.05
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 0
bufferTimeMultiplier: 1
bufferSizeLimit: 64
catchupThreshold: 4
catchupMultiplier: 0.1
showGizmos: 1
showOverlay: 1
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
--- !u!114 &6207632454083444980
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -885,6 +789,36 @@ MonoBehaviour:
showOverlay: 0
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
target: {fileID: 981273033772084037}
--- !u!114 &-7261721819113345487
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 734b48bea0b204338958ee3d885e11f0, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
clientAuthority: 0
sendInterval: 0.05
syncPosition: 1
syncRotation: 1
syncScale: 0
interpolatePosition: 1
interpolateRotation: 1
interpolateScale: 0
bufferTimeMultiplier: 1
bufferSizeLimit: 64
catchupThreshold: 4
catchupMultiplier: 0.1
showGizmos: 0
showOverlay: 0
overlayColor: {r: 0, g: 0, b: 0, a: 0.5}
target: {fileID: 2848367205963120269}
--- !u!95 &8957579265169979397
Animator:
serializedVersion: 4
@@ -921,62 +855,6 @@ MonoBehaviour:
- m_Rig: {fileID: 8865635171929772803}
m_Active: 1
m_Effectors: []
--- !u!114 &4276885029697240453
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b366149a1bdd3ad4884ac2afe0fe11a1, type: 3}
m_Name:
m_EditorClassIdentifier:
gun: {fileID: 3682030003239559187}
gunHolder: {fileID: 6522444664664986769}
gunPositionObj: {fileID: 7263663517583319679}
gunRotationObj: {fileID: 7768205653369755348}
positionRecoil: 1
rotationRecoil: 1
positionMultX: 0.2
positionMultY: 0.5
positionMultZ: 1
playerMouseLook: {fileID: 5630859218361338035}
cameraRecoilX: 8
cameraRecoilY: 4
rotX: 1
rotationMultX: 60
rotationOffsetX: 0.1
rotY: 1
rotationMultY: 50
rotZ: 1
rotationMultZ: 100
ADSController: {fileID: 7198056240135858432}
sideSwey: 1
sweyMult: 1.2
sweyWhileAim: 0.05
returnForce: 0.006
impulsForce: 0.025
maxRecoil: 0.25
--- !u!114 &7198056240135858432
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 916f2d37f60a91149bbca3280a1b69ec, type: 3}
m_Name:
m_EditorClassIdentifier:
aimSpeed: 0.09
aimVal: 1
gun: {fileID: 6522444664664986769}
AimPoint: {fileID: 2992488853448454767}
HoldPoint: {fileID: 8043317747957554736}
isAiming: 0
--- !u!1 &6272346181657429393
GameObject:
m_ObjectHideFlags: 0
@@ -1007,7 +885,6 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 5021921342190399731}
- {fileID: 4074665071222326704}
- {fileID: 1979435770070801855}
- {fileID: 1468248131875751636}
@@ -1021,7 +898,7 @@ Camera:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181657429393}
m_Enabled: 1
m_Enabled: 0
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
@@ -1130,9 +1007,9 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 6035287771982183217}
- {fileID: 3087782655464804516}
- {fileID: 2848367205963120269}
m_Father: {fileID: 6272346181657429396}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &909517976577723968
MonoBehaviour:
@@ -1211,96 +1088,6 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &7263663517583319679
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3087782655464804516}
- component: {fileID: 3590891737052679150}
m_Layer: 0
m_Name: GunPosition
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3087782655464804516
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7263663517583319679}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.04}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2848367205963120269}
m_Father: {fileID: 4074665071222326704}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3590891737052679150
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7263663517583319679}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &7768205653369755348
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2848367205963120269}
- component: {fileID: 8468733188726769796}
m_Layer: 0
m_Name: GunRotation
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &2848367205963120269
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7768205653369755348}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4058555163434875561}
m_Father: {fileID: 3087782655464804516}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8468733188726769796
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7768205653369755348}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48948dfe9d76b07488dacd46a7955fa1, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8043317747957554736
GameObject:
m_ObjectHideFlags: 0
@@ -1325,83 +1112,99 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8043317747957554736}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.108, y: -0.084, z: 0.35}
m_LocalPosition: {x: 0.108, y: -0.084, z: 0.266}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 6272346181657429396}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &4600527171543473474
--- !u!1001 &3292089710699836531
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 2848367205963120269}
m_TransformParent: {fileID: 4074665071222326704}
m_Modifications:
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_RootOrder
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.y
value: -0.054000046
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalPosition.z
value: -0.13
value: 0.03999999
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.w
value: 0.7071068
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.y
value: 0.7071068
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 90
value: 0
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
- target: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
propertyPath: m_Name
value: M92
objectReference: {fileID: 0}
- target: {fileID: 5866666021909216657, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
propertyPath: m_Controller
value:
objectReference: {fileID: 9100000, guid: daf332133edb41440a3abb1cf6e24558, type: 2}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
--- !u!1 &7768205653369755348 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 5071598280516985511, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2848367205963120269 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 732033708985862910, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!1 &3682030003239559187 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
m_PrefabInstance: {fileID: 4600527171543473474}
m_CorrespondingSourceObject: {fileID: 2213212323547960416, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!4 &4058555163434875561 stripped
--- !u!1 &3649358604728444914 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2236875552107647873, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!4 &2781132594439880980 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: d1ac7df45c0d7e84993ff57afe3c4d6f, type: 3}
m_PrefabInstance: {fileID: 4600527171543473474}
m_CorrespondingSourceObject: {fileID: 808197646603973991, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!4 &9064841067161443684 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 5792494204646893847, guid: bd217f9f85ce78e46a925776562625e8, type: 3}
m_PrefabInstance: {fileID: 3292089710699836531}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &6305701708507383038
PrefabInstance:
@@ -1561,6 +1364,11 @@ GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 01316cb596562384da845bc519fb90de, type: 3}
m_PrefabInstance: {fileID: 6305701708507383038}
m_PrefabAsset: {fileID: 0}
--- !u!4 &5767109144009335573 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 01316cb596562384da845bc519fb90de, type: 3}
m_PrefabInstance: {fileID: 6305701708507383038}
m_PrefabAsset: {fileID: 0}
--- !u!4 &8334588817950881727 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -6617984589164989631, guid: 01316cb596562384da845bc519fb90de, type: 3}
@@ -1591,8 +1399,3 @@ Transform:
m_CorrespondingSourceObject: {fileID: -5815427104119794202, guid: 01316cb596562384da845bc519fb90de, type: 3}
m_PrefabInstance: {fileID: 6305701708507383038}
m_PrefabAsset: {fileID: 0}
--- !u!4 &5767109144009335573 stripped
Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 01316cb596562384da845bc519fb90de, type: 3}
m_PrefabInstance: {fileID: 6305701708507383038}
m_PrefabAsset: {fileID: 0}

View File

@@ -389,18 +389,21 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 124e7dc536a7de8418284dc873cb1bb2, type: 3}
m_Name:
m_EditorClassIdentifier:
syncMode: 0
syncInterval: 0.1
ADSContoller: {fileID: 0}
walkSpeed: 6
sprintSpeed: 8
aimWalkSpeed: 3
moveSmoothTime: 0.05
gravity: -10
jumpHeight: 1.2
inputDirection: {x: 0, y: 0, z: 0}
groundCheck: {fileID: 6272346182417644039}
groundMask:
serializedVersion: 2
@@ -461,7 +464,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a8493f0e2b0d4bd4f98d3cd81c2db5ad, type: 3}
m_Name:
@@ -474,9 +477,9 @@ MonoBehaviour:
maxCameraAngle: 90
neckStartAngle: 0
minCameraAngle: -90
neckLength: 0.2
mouseSmoothTime: 0.001
lockCursor: 1
fullPitch: 0
--- !u!114 &8436279266335313624
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -484,7 +487,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3317f24e780855847830f5662153b41d, type: 3}
m_Name:
@@ -503,7 +506,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4db7caf602ce379408a59c8722e06e46, type: 3}
m_Name:
@@ -511,12 +514,15 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0.1
playerController: {fileID: -4574526707603160507}
gunAnimation: {fileID: 0}
posCheckDistance: 1
checkDist: 0
stepAmplitudeWalking: 0.05
stepAmplitudeSprinting: 0.07
stepFrequency: 0.8
Neck: {fileID: 6272346181657429396}
gunRotation: {fileID: 0}
rotationMultiplier: 0.1
--- !u!114 &3781802212159559521
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -524,7 +530,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6272346181302961293}
m_Enabled: 1
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bc5bc2b49bd326e4db460a6a3af59311, type: 3}
m_Name:
@@ -532,6 +538,9 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0.1
muzzle: {fileID: 3649358604728444914}
shootAnim: {fileID: 0}
fireRate: 0
gunHoldPos: {fileID: 0}
--- !u!114 &6207632454083444980
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@@ -8,7 +8,7 @@ using Mirror;
public class PlayerController : NetworkBehaviour
{
[SerializeField] private AimDownSights ADSContoller;
[SerializeField] private ProcedualAnimationController procedualAnimationController;
[Header("Movement")]
[SerializeField] private float walkSpeed = 6.0f;
[SerializeField] private float sprintSpeed = 10.0f;
@@ -36,7 +36,8 @@ public class PlayerController : NetworkBehaviour
private Vector3 currentDir = Vector3.zero;
private Vector3 currentDirVelocity = Vector3.zero;
private Vector3 velocity = Vector3.zero;
public Vector3 velocity = Vector3.zero;
private Vector3 refVelocity = Vector3.zero;
private void Start()
@@ -65,8 +66,8 @@ public class PlayerController : NetworkBehaviour
public bool isMoving()
{
if (velocity.x == 0 && velocity.y == 0 && velocity.z == 0) return true;
else return false;
if (velocity.x == 0 && velocity.y == 0 && velocity.z == 0) return false;
else return true;
}
private void CheckGoundAngle()
@@ -101,16 +102,18 @@ public class PlayerController : NetworkBehaviour
{
if (Input.GetAxisRaw("Sprint") > 0 && isGrounded && !ADSContoller.isAiming)
{
if (Input.GetAxisRaw("Sprint") > 0 && isGrounded && !procedualAnimationController.isAiming)
{
movementSpeed = sprintSpeed;
isSprinting = true;
}
else
{
if(ADSContoller.isAiming) movementSpeed = aimWalkSpeed;
if(procedualAnimationController.isAiming) movementSpeed = aimWalkSpeed;
else movementSpeed = walkSpeed;
isSprinting = false;
}
//Grounded
@@ -133,6 +136,7 @@ public class PlayerController : NetworkBehaviour
}
inputDirection = new Vector3(Input.GetAxisRaw("Horizontal"),0, Input.GetAxisRaw("Vertical")); //Get Inputs
inputDirection.Normalize(); //Damit schr<68>g laufen nicht schneller ist
if (isGrounded)
@@ -145,11 +149,8 @@ public class PlayerController : NetworkBehaviour
currentDir = moveDirection;
}
velocity = currentDir * movementSpeed + new Vector3(0, velocityY, 0);
velocity = Vector3.SmoothDamp(velocity, currentDir * movementSpeed + new Vector3(0, velocityY, 0),ref refVelocity,0.01f);
controller.Move(velocity * Time.deltaTime);
}
}

View File

@@ -35,7 +35,7 @@ public class PlayerMouseLook : NetworkBehaviour
{
controller = GetComponent<CharacterController>();
playerCamera.gameObject.SetActive(true);
playerCamera.GetComponent<Camera>().enabled = true;
neckLength = Vector3.Distance(playerNeck.position,playerCamera.position);
if (lockCursor)
@@ -52,7 +52,7 @@ public class PlayerMouseLook : NetworkBehaviour
{
UpdateMouseLook();
}
}
private void UpdateMouseLook()

View File

@@ -0,0 +1,306 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class ProcedualAnimationController : NetworkBehaviour
{
[Header("Step Settings")]
[SerializeField] private float stepAmplitudeWalking;
[SerializeField] private float stepAmplitudeSprinting;
[SerializeField] private float stepFrequency;
private float checkDist = 0f;
private float stepDistance = 1;
private float stepSin;
float moveSoftStart = 0;
Vector3 lastPos = Vector3.zero;
float posCheckDistance = 0.01f;
float currentDist = 0;
float f = 0f;
[SerializeField] private PlayerController playerController;
[Header("GameObjects")]
[SerializeField] private float currentCameraRecoilX = 0f;
[SerializeField] private float currentCameraRecoilY = 0f;
[Header("GameObjects")]
[SerializeField] private GameObject gun; // The gun object with the animator on it.
[SerializeField] private GameObject gunHolder;
[Header("General Settings")]
[SerializeField] bool positionRecoil = true;
[SerializeField] bool rotationRecoil = true;
[Header("Position Settings")]
[SerializeField] float positionMultX = 25f;
[SerializeField] float positionMultY = 25f;
[SerializeField] float positionMultZ = 25f;
[Header("Rotation Settings")]
[SerializeField] PlayerMouseLook playerMouseLook;
[SerializeField] float cameraRecoilX = 0.1f;
[SerializeField] float cameraRecoilY = 0.1f;
[SerializeField] bool rotX = true;
[SerializeField] float rotationMultX = 25f;
[SerializeField] float rotationOffsetX = 0.1f;
[SerializeField] bool rotY = true;
[SerializeField] float rotationMultY = 25f;
[SerializeField] bool rotZ = true;
[SerializeField] float rotationMultZ = 15f;
[Header("Swey Settings")]
[SerializeField] bool sideSwey = true;
[SerializeField] float sweyMultX = 15f;
[SerializeField] float sweyMultY = 15f;
[SerializeField] float sweyMultZ = 15f;
[SerializeField] float sweyWhileAim = 0.1f;
float swey = 0f;
[Header("External Settings")]
[SerializeField] const int externalPositionVectorsNum = 1;
private Vector3[] externalPositionVectors = new Vector3[externalPositionVectorsNum];
[SerializeField] float returnForce = 0.006f;
[SerializeField] float impulsForce = 0.025f;
[SerializeField] float maxRecoil = 0.1f;
private Animator gunAnimator;
Vector3 startPos, startRot;
float recoilOffset = 0f;
float zOffset = 0f;
float zVelocity = 0f;
int recoilCounter = 0;
[Header("Aiming Settings")]
[SerializeField] float aimSpeed = 0.01f;
[Range(0, 1)] public float aimVal = 0;
[SerializeField] GameObject AimPoint;
[SerializeField] GameObject HoldPoint;
public bool isAiming = false;
Vector3[] positionMod = new Vector3[3];
Quaternion[] rotationMod = new Quaternion[3];
public void OnSwitchWeapon(float fireRate)
{
if (isLocalPlayer)
{
//gun = newGun;
gunAnimator = gun.GetComponent<Animator>();
gunAnimator.SetFloat("ShootSpeed", 1f / (60f / fireRate));
//startPos = gunPositionObj.transform.localPosition;
//startRot = gunRotationObj.transform.localRotation.eulerAngles;
}
}
public void Recoil(float force)
{
if (isLocalPlayer)
{
//Play the animation
gunAnimator.Play("Shoot");
//Add force for the recoil
//currentCameraRecoilX -= weightedPerlinNoise(cameraRecoilX, 1f, Time.time, 1);
//playerMouseLook = Mathf.SmoothDamp(playerMouseLook.fullPitch, playerMouseLook.fullPitch - weightedPerlinNoise(cameraRecoilX, 1f, Time.time, 1),ref f,0.01f);
CmdRecoil();
}
}
[Command]
private void CmdRecoil()
{
recoilCounter++;
playerMouseLook.fullPitch -= weightedPerlinNoise(cameraRecoilX, 1f, Time.time, 1);
transform.Rotate(Vector3.up * weightedPerlinNoise(cameraRecoilY, 1f, Time.time, 1f, -0.5f));
}
[Command]
private void CmdAim(bool input)
{
if (input) isAiming = true;
else isAiming = false;
}
void Update()
{
if (isLocalPlayer)
{
CmdAim(Input.GetButton("Aim"));
}
/*-----Aiming-----*/
}
private void FixedUpdate()
{
if (isServer)
{
positionMod = new Vector3[3];
rotationMod = new Quaternion[3];
/*-----Recoil-----*/
calcRecoilOffset();
/*-----Position Recoil-----*/
PositionRecoil();
/*-----Rotation Recoil-----*/
RotationRecoil();
/*-----Step Swey-----*/
calcStepSin();
SideStep();
/*-----Aiming-----*/
AimDownSights();
/*-----Apply Gun Position-----*/
Vector3 totalPosition = Vector3.zero;
for (int i = 0; i < positionMod.Length; i++)
{
if (positionMod[i] != null)
totalPosition += positionMod[i];
}
/*-----Apply Gun Rotation-----*/
Quaternion totalRotation = Quaternion.identity;
for (int i = 0; i < rotationMod.Length; i++)
{
totalRotation *= rotationMod[i];
}
//gunHolder.transform.localPosition = positionMod[2];
gunHolder.transform.localPosition = totalPosition;
//gunHolder.transform.localRotation = totalRotation;
gunHolder.transform.localRotation = rotationMod[0];
}
}
void RotationRecoil()
{
/*-----Rotation Recoil-----*/
if (rotationRecoil)
{
float deltaX = 100f * rotationMultX * weightedPerlinNoise(recoilOffset, 0.5f, Time.time, 1f);
float deltaY = 100f * rotationMultY * weightedPerlinNoise(recoilOffset, 0.5f, Time.time, 1f, -0.5f);
float deltaZ = 100f * rotationMultZ * weightedPerlinNoise(recoilOffset, 0.5f, Time.time, 1f, -0.5f);
rotationMod[0] = Quaternion.Euler(deltaX, deltaY, deltaZ);
}
}
void PositionRecoil()
{
if (positionRecoil)
{
float deltaX = -positionMultX * weightedPerlinNoise(recoilOffset, 0.7f, Time.time, 1f, -0.5f);
float deltaY = -positionMultY * weightedPerlinNoise(recoilOffset, 0.5f, Time.time, 2f);
float deltaZ = positionMultZ * weightedPerlinNoise(recoilOffset, 0.5f, Time.time, 3f);
positionMod[0] = new Vector3(deltaX, deltaY, deltaZ);
}
}
void AimDownSights()
{
aimVal = gravityValue(aimVal, aimSpeed, 1, 0, isAiming);
positionMod[2] = Vector3.Lerp(HoldPoint.transform.localPosition, AimPoint.transform.localPosition, Mathf.Pow(aimVal, 1.3f));
}
void calcRecoilOffset()
{
for (int i = 0; i < recoilCounter; i++)
{
zVelocity -= weightedPerlinNoise(impulsForce, 0.1f, i, 1f);
}
recoilCounter = 0;
recoilOffset += zVelocity;
zVelocity = 0;
if (recoilOffset > 0)
recoilOffset = 0f;
else if (recoilOffset < 0)
zVelocity += weightedPerlinNoise(returnForce, 0.1f, Time.time, 1f);
recoilOffset = Mathf.Clamp(recoilOffset, -weightedPerlinNoise(maxRecoil, 0.5f, Time.time * 1000, 1f), 0);
}
void calcStepSin()
{
float amplitude;
float dist = Vector3.Distance(lastPos, this.transform.position);
if (playerController.isSprinting)
amplitude = stepAmplitudeSprinting;
else
amplitude = stepAmplitudeWalking;
if (dist > posCheckDistance)
{
currentDist += dist;
lastPos = this.transform.position;
}
else
{
checkDist = currentDist + dist;
}
stepSin = ezSin(stepAmplitudeWalking, stepFrequency, currentDist);
}
void SideStep()
{
if (sideSwey)
{
//To start and end the sweying motion softly
moveSoftStart = gravityValue(moveSoftStart, 0.1f, 0.03f, 1f, 0f, playerController.isMoving() && playerController.isGrounded);
if (playerController.isMoving())
{
float deltaX = sweyMultX * moveSoftStart * Mathf.Clamp(Vector3.Magnitude(playerController.velocity), 0, 1) * weightedPerlinNoise(stepSin, 0.3f, Time.time, 10f, 0.5f) * Mathf.Clamp((1 - aimVal) * (1 - aimVal), sweyWhileAim, 1f);
float deltaY = sweyMultY * moveSoftStart * Mathf.Clamp(Vector3.Magnitude(playerController.velocity), 0, 1) * weightedPerlinNoise(stepSin, 0.7f, Time.time, 20f, -0.5f) * Mathf.Clamp((1 - aimVal) * (1 - aimVal), sweyWhileAim, 1f);
float deltaZ = sweyMultZ * moveSoftStart * Mathf.Clamp(Vector3.Magnitude(playerController.velocity), 0, 1) * weightedPerlinNoise(stepSin, 0.3f, Time.time, 30f, 0.5f) * Mathf.Clamp((1 - aimVal) * (1 - aimVal), sweyWhileAim, 1f);
positionMod[1] = new Vector3(deltaX, deltaY, deltaZ);
}
}
}
/*-----Helper Methods-----*/
float gravityValue(float curretnValue, float rateOfChange, float maxValue, float minValue, bool add)
{
// The currentValue will be advanced or reduced by the rateOfChange depending on the add boolean. But only in the specified range.
// Usage: val = gravityValue(val, 0.01f, 1, 0, true);
float value = curretnValue;
if (add) value += rateOfChange;
else value -= rateOfChange;
return Mathf.Clamp(value, minValue, maxValue);
}
float weightedPerlinNoise(float value, float weight, float pX, float pY, float offset = 0f)
{
return value * (1f - weight) + value * weight * (Mathf.PerlinNoise(pX, pY) + offset);
}
float gravityValue(float curretnValue, float rateOfChangePos, float rateOfChangeNeg, float maxValue, float minValue, bool add)
{
// The currentValue will be advanced by the rateOfChangePos and reduced by the rateOfChangeNeg depending on the add boolean. But only in the specified range.
// Usage: val = gravityValue(val, 0.01f, 0.05f, 1, 0, true);
float value = curretnValue;
if (add) value += rateOfChangePos;
else value -= rateOfChangeNeg;
return Mathf.Clamp(value, minValue, maxValue);
}
private float ezSin(float amplitude, float frequency, float x)
{
// Simplification of the sin function.
return amplitude * Mathf.Sin((x / 3.1831f) * 10 * frequency);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9bd09d0992070b049b461b56fd022956
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -6,7 +6,7 @@ using Mirror;
public class Shoot : NetworkBehaviour
{
[SerializeField] GameObject muzzle;
[SerializeField] ShootAnimation shootAnim;
[SerializeField] ProcedualAnimationController shootAnim;
[SerializeField] float fireRate;
[SerializeField] GameObject gunHoldPos;
@@ -40,6 +40,9 @@ public class Shoot : NetworkBehaviour
if (Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit))
{
GameObject g = GameObject.CreatePrimitive(PrimitiveType.Sphere);
g.transform.position = hit.point;
g.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
if (hit.transform.gameObject.GetComponent<Player>() != null)
{
dedplayer = hit.transform.gameObject;
@@ -53,6 +56,6 @@ public class Shoot : NetworkBehaviour
// This code will be executed on the Client.
void shootAnimation()
{
shootAnim.recoil(gunHoldPos,0.1f);
shootAnim.Recoil(0.1f);
}
}