diff --git a/Assets/Scenes/MainGameplayScene.unity b/Assets/Scenes/MainGameplayScene.unity index 7779a3d..30a44b4 100644 --- a/Assets/Scenes/MainGameplayScene.unity +++ b/Assets/Scenes/MainGameplayScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:69828bf48a3e1b2ad75c94c5c7920507f8f8d7aa6f5483f47a889a2b527d942b -size 655013 +oid sha256:cff5435899d1eccf8fbba0724eed7fbf71d4920bbf35bd4168af93cb0918d851 +size 657501 diff --git a/Assets/Scenes/PlayerJoinScene.unity b/Assets/Scenes/PlayerJoinScene.unity index d5da38f..3410be3 100644 --- a/Assets/Scenes/PlayerJoinScene.unity +++ b/Assets/Scenes/PlayerJoinScene.unity @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7bbf138ceeb4fa2cf0afbe0709f0cd128e6f2199a5e6e909864e15c6ffec0a46 -size 40588 +oid sha256:50ef57180cb7e056bf7a20f27eada4434bdd64e9bb7120f0509ba56cdfd503e1 +size 40595 diff --git a/Assets/Scripts/Behaviours/YeetController.cs b/Assets/Scripts/Behaviours/YeetController.cs index ea38e32..c5e472c 100644 --- a/Assets/Scripts/Behaviours/YeetController.cs +++ b/Assets/Scripts/Behaviours/YeetController.cs @@ -5,6 +5,8 @@ using UnityEngine.InputSystem; public class YeetController : InputBehaviour { + [Tooltip("This is where the babies are held")] + public GameObject handCarryingPosition; public GameObject parent { get; set; } public float yeetVelocity = 5f; @@ -56,9 +58,9 @@ public class YeetController : InputBehaviour _child.transform.parent = null; _child.transform.rotation = parent.transform.rotation; - _child.GetComponent().held = true; + _child.GetComponent().held = false; - _child.GetComponent().velocity = _child.transform.forward * m_velocityWindup + _child.transform.up * m_velocityWindup; + _child.GetComponent().velocity = calculateVelocityVector(); yeetState = YeetState.Yeeting; m_time = yeetDuration; m_velocityWindup = 0; @@ -87,12 +89,13 @@ public class YeetController : InputBehaviour case YeetState.Held: // draw yeet lines + _child.transform.position = handCarryingPosition.transform.position; if(m_velocityWindup < yeetVelocity) { m_velocityWindup += windupSpeed; } - Vector3 velocity = parent.transform.forward * m_velocityWindup + parent.transform.up * m_velocityWindup; + Vector3 velocity = calculateVelocityVector(); float t; t = (-1f * velocity.y) / Physics.gravity.y; @@ -114,6 +117,11 @@ public class YeetController : InputBehaviour } } + private Vector3 calculateVelocityVector() + { + return parent.transform.forward * m_velocityWindup + parent.transform.up * m_velocityWindup; + } + private void OnTriggerEnter(Collider collider) { Debug.Log("PlayerInputController.OnTriggerEnter: arrived"); diff --git a/Assets/World Assets/Prefabs/Player.prefab b/Assets/World Assets/Prefabs/Player.prefab index df8222a..d882e4a 100644 --- a/Assets/World Assets/Prefabs/Player.prefab +++ b/Assets/World Assets/Prefabs/Player.prefab @@ -125,10 +125,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 188bb300967eea14fb681a94fc31f911, type: 3} m_Name: m_EditorClassIdentifier: + handCarryingPosition: {fileID: 6686278636936064271} yeetVelocity: 20 yeetDuration: 2 windupSpeed: 0.05 m_YeetAnimator: {fileID: 7280267804803618209} + trajectoryLineMaterial: {fileID: 10301, guid: 0000000000000000f000000000000000, type: 0} --- !u!1 &6496616781582263990 GameObject: m_ObjectHideFlags: 0 @@ -158,7 +160,7 @@ Transform: m_LocalScale: {x: -1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 7280267804154012179} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &9135536610966766493 SpriteRenderer: @@ -211,6 +213,36 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!1 &6686278636936064271 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6137936579796069125} + m_Layer: 0 + m_Name: HandCarryingPosition + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &6137936579796069125 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6686278636936064271} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 12.99, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} + m_Children: [] + m_Father: {fileID: 7280267804154012179} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &7280267804154012178 GameObject: m_ObjectHideFlags: 0 @@ -239,6 +271,7 @@ Transform: m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} m_Children: + - {fileID: 6137936579796069125} - {fileID: 7280267804702354914} - {fileID: 7280267804803618211} - {fileID: 5965212798371097713} @@ -289,7 +322,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 7280267804154012179} - m_RootOrder: 0 + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &7280267804702354913 SpriteRenderer: @@ -391,7 +424,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 7280267804154012179} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!212 &7280267804803618210 SpriteRenderer: diff --git a/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab b/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab deleted file mode 100644 index f15e3be..0000000 --- a/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab +++ /dev/null @@ -1,135 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &1051237570 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 33932531309654967} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 188bb300967eea14fb681a94fc31f911, type: 3} - m_Name: - m_EditorClassIdentifier: - yeetVelocity: 20 - yeetDuration: 2 - windupSpeed: 0.05 ---- !u!1001 &2714160732044909285 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 2725293204815276921, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_Mesh - value: - objectReference: {fileID: 0} - - target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_Mesh - value: - objectReference: {fileID: 0} - - target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_Convex - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_IsTrigger - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293204815276927, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_Mesh - value: - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018834, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_Name - value: YeetyPlayer Variant - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_RootOrder - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalScale.x - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalScale.y - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalScale.z - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalPosition.x - value: 1.2684288 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalPosition.z - value: -6.7718506 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018845, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_DefaultActionMap - value: 63e31309-151e-48ff-854a-81cb2511f050 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018846, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_SlopeLimit - value: 90 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: body - value: - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: testChild - value: - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_playerSpeed - value: 10 - objectReference: {fileID: 0} - - target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3} - propertyPath: m_rotationSpeed - value: 10 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 47d3f018734864140ba302f6972ba575, type: 3} ---- !u!1 &33932531309654967 stripped -GameObject: - m_CorrespondingSourceObject: {fileID: 2725293205319018834, guid: 47d3f018734864140ba302f6972ba575, type: 3} - m_PrefabInstance: {fileID: 2714160732044909285} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta b/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta deleted file mode 100644 index f280892..0000000 --- a/Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: c3cc089e72190e74aab4c6592121b553 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: