init
This commit is contained in:
commit
341a877b4a
2338 changed files with 1346408 additions and 0 deletions
21
Assets/Scripts/Enemies/BossJointsIK.cs
Normal file
21
Assets/Scripts/Enemies/BossJointsIK.cs
Normal file
|
@ -0,0 +1,21 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[ExecuteAlways]
|
||||
public class BossJointsIK : MonoBehaviour
|
||||
{
|
||||
public float angleThreshold = 0;
|
||||
public Transform joint1;
|
||||
public Transform joint2;
|
||||
public Transform endEffector;
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
joint2.localEulerAngles = new Vector3(0, 0, 180-angleThreshold)-new Vector3(joint1.localEulerAngles.x, joint1.localEulerAngles.x,
|
||||
Utils.remap(Mathf.Abs(joint1.localEulerAngles.z), 0, 90, angleThreshold, 180))+new Vector3(.066f, 3.421f, 0);
|
||||
endEffector.rotation = Quaternion.LookRotation(Vector3.forward, Vector3.up)*Quaternion.Euler(new Vector3(0, 90, 0));
|
||||
endEffector.localEulerAngles += new Vector3(1.066f, 3.421f, 0);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue