error code cs1002

im trying to make a vr game but i get this error code when im doing my script

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

private object gripCurrent;

[RequireComponent(typeof(Animator))]
public class Hand : MonoBehaviour
{
    Animator animator;
    public float speed;
    private object gripTarget;
    private object triggerTarget;
    private float gripCurrent;
    private float triggerCurrent;
    private object AnimatorGripParam = "Grip";
    private object AnimatorTriggerParam = "trigger";
    // Start is called before the first frame update
    void Start()
    {
        Animator = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        AnimateHand();
    }

    internal void SetGrip(float v)
    {
        gripTarget = v;
    }

    internal void SetTrigger(float v)
    {
        triggerTarget = v;
    }
}

void AnimateHand()
{
    if (gripCurrent != gripTarget)
   
   gripCurrent = Mathf.MoveTowards(gripCurrent, gripTarget, Time.deltaTime) * speed );
    animator.SetFloat(AnimatorGripParan, gripCurrent);
    if (triggerCurrent != gripTarget)
   
   triggerCurrent = Mathf.MoveTowards(triggerCurrent, triggerTarget, Time.deltaTime * speed);
   animator.SetFloat(AnimatortriggerParan, triggerCurrent);
    }

}

Always…ALWAYS post the entire error. Most people don’t memorize error codes. Help people to help you.

Thumbs up for using code tags though. But as far as your error goes, you appear to have AnimateHand outside your class closing bracket. Line 40 seems to close your class out, so you need to move the AnimateHand method up above line 40. That or delete line 40. Just count your closing and opening brackets. That’s definitely the source of your error.

How to understand compiler and other errors and even fix them yourself:

https://discussions.unity.com/t/824586/8

thanks for the help it worked

ok now i have this problem my error code is asset/scripts/hand.cs(54,6): error:1513:} expected

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;



[RequireComponent(typeof(Animator))]
public class Hand : MonoBehaviour
{
    Animator animator;
    public float speed;
    private object gripTarget;
    private object triggerTarget;
    private float gripCurrent;
    private float triggerCurrent;
    private object AnimatorGripParam = "Grip";
    private object AnimatorTriggerParam = "trigger";
    // Start is called before the first frame update
    void Start()
    {
        Animator = GetComponent<Animator>();
    }

    // Update is called once per frame
    void Update()
    {
        AnimateHand();
    }

    internal void SetGrip(float v)
    {
        gripTarget = v;
    }

    internal void SetTrigger(float v)
    {
        triggerTarget = v;
    }
}

void AnimateHand()
{
    if (gripCurrent != gripTarget);

    gripCurrent = Mathf.MoveTowards(gripCurrent, gripTarget, Time.deltaTime) * speed;
    animator.SetFloat(AnimatorGripParan, gripCurrent);

    if (triggerCurrent != gripTarget);
    {
        triggerCurrent = Mathf.MoveTowards(triggerCurrent, triggerTarget, Time.deltaTime * speed);
        animator.SetFloat(AnimatortriggerParan, triggerCurrent);

    }

I guess it didn’t work!

Go back and carefully read the post to figure out errors. 100% of the information you need is in that error.

IF you’re gonna just be randomly typing scripts in, you need to get them 100% perfect: perfect spelling, perfect capitalization, perfect punctuation and perfect spacing.

One character out of place and it fails.