Worked on hand colliders. Left them not implemented yet. Fixed spray table teleport block.
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine;
|
||||
|
||||
public class HandPresencePhysics : MonoBehaviour
|
||||
{
|
||||
@@ -11,18 +9,15 @@ public class HandPresencePhysics : MonoBehaviour
|
||||
{
|
||||
rb = GetComponent<Rigidbody>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
//
|
||||
void FixedUpdate()
|
||||
{
|
||||
//position
|
||||
rb.velocity = (target.position - transform.position) / Time.fixedDeltaTime;
|
||||
|
||||
//rotation
|
||||
Quaternion rotationDifference = target.rotation * Quaternion.Inverse(transform.rotation);
|
||||
rotationDifference.ToAngleAxis(out float angleInDegree, out Vector3 rotationAxis);
|
||||
|
||||
Vector3 rotationDifferenceInDegree = angleInDegree * rotationAxis;
|
||||
rb.angularVelocity = (rotationDifferenceInDegree * Mathf.Deg2Rad / Time.fixedDeltaTime);
|
||||
Vector3 rotationDifferenceInDegree = angleInDegree * rotationAxis; rb.angularVelocity = (rotationDifferenceInDegree * Mathf.Deg2Rad / Time.fixedDeltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user