Commit 711b0257 authored by Jenny's avatar Jenny
Browse files

changed animations

made jump loop and made glide animation work
parent d5eb27e3
......@@ -46,7 +46,7 @@ ModelImporter:
cycleOffset: 0
loop: 0
hasAdditiveReferencePose: 0
loopTime: 0
loopTime: 1
loopBlend: 0
loopBlendOrientation: 0
loopBlendPositionY: 0
......
......@@ -174,25 +174,31 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Jump
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: AnimSpeed
m_Type: 1
m_DefaultFloat: 1
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: PickUp
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: Motion
m_Type: 1
m_DefaultFloat: 2
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
......@@ -360,8 +366,8 @@ AnimatorState:
type: 3}
m_Tag:
m_SpeedParameter: AnimSpeed
m_MirrorParameter:
m_CycleOffsetParameter: Speed
m_MirrorParameter: Jump
m_CycleOffsetParameter: Motion
m_TimeParameter: Speed
--- !u!1101 &6964413758257151049
AnimatorStateTransition:
......
......@@ -9599,7 +9599,7 @@ PrefabInstance:
- target: {fileID: 1331997591070191852, guid: 2342577add2bab844a55e25cc4fea601,
type: 3}
propertyPath: pushPower
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1331997591070191852, guid: 2342577add2bab844a55e25cc4fea601,
type: 3}
......
......@@ -122,6 +122,7 @@ public class PlayerPickUp : MonoBehaviour
if (interactiveobjects.Contains(other.gameObject))
{
interactiveobjects.Remove(other.gameObject);
anim.SetBool("PickUp", false);
}
}
......
......@@ -64,6 +64,7 @@ public class SCTPSController : MonoBehaviour
public bool running;
public float jumpLength;
public bool gliding;
void Start()
{
......@@ -195,10 +196,14 @@ public class SCTPSController : MonoBehaviour
onGround = false;
}
if (Input.GetButton("Jump"))
if (!gliding && Input.GetButton("Jump"))
{
jumpLength += 1f;
}
else if (gliding == true)
{
jumpLength = 0;
}
if (jumpLength > 0)
{
......@@ -220,18 +225,21 @@ public class SCTPSController : MonoBehaviour
if (!characterController.isGrounded && Input.GetKey(KeyCode.LeftShift))
{
gliding = true;
Glide();
gravity = 10f;
glidesDone++;
moveDirection.x = Input.GetAxis("Horizontal") * glideSpeed;
moveDirection.z = Input.GetAxis("Vertical") * glideSpeed;
moveDirection = transform.TransformDirection(moveDirection);
Glide();
}
else
{
gravity = 30f;
gliding = false;
}
if (glidesDone >= 10)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment