ADD{}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rigidbody : MonoBehaviour
{
private Rigidbody myRigid;
void Start()
{
myRigid = GetComponent<Rigidbody>();
rotation = this.transform.eulerAngles;
}
void Update()
{
if (Input.GetKey(KeyCode.F))
{
// myRigid.velocity = Vector3.forward; 정지
// myRigid.angularVelocity = Vector3.right; 회전
// myRigid.maxAngularVelocity = 100; 회전 속도
rotation += new Vector3(90, 0, 0) * Time.deltaTime;
myRigid.MoveRotation(Quaternion.Euler(rotation); // 물리법칙 x 이동
myRigid.AddForce(Vector3.forward); // 물리법칙 영향 이동
myRigid.AddExplosionForce(힘, 위치, 반경)
}
}
}