Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug "CS1022: Type or namespace definition, or end-of-file expected" error.

Discussion in 'Code Editors & IDEs' started by mj-sin, Mar 2, 2023.

  1. mj-sin

    mj-sin

    Joined:
    Feb 22, 2023
    Posts:
    1
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class grabbable : MonoBehaviour
    {
    public Transform holding;
    public bool held;
    Transform tr;

    private void Update()
    {
    if(held)
    {
    private void holding.GetPositionAndRotation(out Vector3 holdingPoint, out Quaternion rotation);
    private void GetPositionAndRotation(out Vector3 position, out Quaternion holdingDirection);
    tr.SetPositionAndRotation(holdingPoint position, holdingDirection rotation);
    }
    }
    }