Worked on hand colliders. Left them not implemented yet. Fixed spray table teleport block.

This commit is contained in:
2025-10-21 15:56:44 +03:00
parent 48860cf906
commit 5623167eb9
10 changed files with 2770 additions and 15 deletions

View File

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