Hello, when I checked the documentation I found a code that I found interesting, however, I copied the example of the documentation and paste it in a script, I get an error, but I have no idea what to do with that, if you could help me I would appreciate it
Code
using System.Collections.Generic;
using UnityEngine;
using Leap.Unity.Interaction;
public class PruebasGrasped : MonoBehaviour {
private InteractionBehaviour _intObj;
void Start() {
_intObj = GetComponent<InteractionBehaviour>();
_intObj.OnGraspedMovement += onGraspedMovement;
}
private void onGraspedMovement(Vector3 presolvedPos, Quaternion presolvedRot,
Vector3 solvedPos, Quaternion solvedRot,
InteractionController graspingController) {
// Project the vector of the motion of the object due to grasping along the world X axis.
Vector3 movementDueToGrasp = solvedPos - presolvedPos;
float xAxisMovement = movementDueToGrasp.x;
// Move the object back to its position before the grasp solve this frame,
// then add just its movement along the world X axis.
_intObj.rigidbody.position = presolvedPos;
_intObj.rigidbody.position += Vector3.right * xAxisMovement;
}
}
error:
No overload for 'onGraspedMovement' matches delegate 'GraspedMovementEvent' [Assembly-CSharp]
No overload for 'onGraspedMovement' matches delegate 'GraspedMovementEvent' [Assembly-CSharp]
void PruebasGrasped.onGraspedMovement(Vector3 presolvedPos, Quaternion presolvedRot, Vector3 solvedPos, **Quaternion solvedRot, InteractionController graspingController)