Browse Source

Babies are now held overhead

develop
MrJDunn 3 years ago
parent
commit
921e3d3cd9
6 changed files with 51 additions and 152 deletions
  1. BIN
      Assets/Scenes/MainGameplayScene.unity
  2. BIN
      Assets/Scenes/PlayerJoinScene.unity
  3. +11
    -3
      Assets/Scripts/Behaviours/YeetController.cs
  4. +36
    -3
      Assets/World Assets/Prefabs/Player.prefab
  5. +0
    -135
      Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab
  6. +0
    -7
      Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta

BIN
Assets/Scenes/MainGameplayScene.unity (Stored with Git LFS) View File

size 657501

BIN
Assets/Scenes/PlayerJoinScene.unity (Stored with Git LFS) View File

size 40595

+ 11
- 3
Assets/Scripts/Behaviours/YeetController.cs View File

@ -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<YeetHandle>().held = true;
_child.GetComponent<YeetHandle>().held = false;
_child.GetComponent<Rigidbody>().velocity = _child.transform.forward * m_velocityWindup + _child.transform.up * m_velocityWindup;
_child.GetComponent<Rigidbody>().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");

+ 36
- 3
Assets/World Assets/Prefabs/Player.prefab View File

@ -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:

+ 0
- 135
Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab View File

@ -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}

+ 0
- 7
Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta View File

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

Loading…
Cancel
Save