Kaystross
Hectopat
- Katılım
- 12 Aralık 2020
- Mesajlar
- 213
- Çözümler
- 1
Daha fazla
- Cinsiyet
- Erkek
Arkadaşlar ufak bir kodlama yaptım işte. Bu bir kapının belli bir noktada durmasını sağlayan bir kod ama script çalışmıyor. Bir el atar mısınız?
Kod bu şekilde.
C#:
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;
}
}
Kod bu şekilde.