using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class door : MonoBehaviour
{
public HingeJoint hinge;
JointMotor motor;
public float velocity;
public float angle;
// Start is called before the first frame update
void Start()
{
motor hinge.motor;
}
// Update is called once per frame
void Update()
{
angle hinge.angle;
motor.targetVelocity = -angle;
hinge.motor = motor;
}
}