플랫폼을 걷고있는 게임 캐릭터가 있습니다. 하늘에서 떨어지는 블록들도 있습니다. 캐릭터가 땅에있을 때 블록이 머리 위에 닿았을 때 나는 Kinematic 블록을 만들고 싶다. 나는 코드가 내 문자에 코드 rigidbody2D.isKinematic("Block",true);
의 마지막 세트에 문제가 있고 그것을 치면 블록이개체를 만드는 방법은 키네틱입니다
using UnityEngine;
using System.Collections;
public class Stop : MonoBehaviour {
bool grounded = false;
public Transform groundCheck;
float groundRadius = .5f;
public LayerMask whatIsGround;
void FixedUpdate()
{
grounded = Physics2D.OverlapCircle(groundCheck.position, groundRadius, whatIsGround);
}
void OnCollisionEnter2D(Collision2D col)
{
if (grounded && col.gameObject.tag == "Block")
{
rigidbody2D.isKinematic("Block",true);
}
}
}
당신은 블록) "rigidbody2D.isKinematic를"대체 스크립트가 ... 첨부 된 게임 오브젝트에 부착 된 강체를 참조하고 ; " – Savlon
이 오류가 발생합니다."Assets/Prefab/Stop.cs (19,29) : 오류 CS1061 : Type UnityEngine.Collision2D '에 rigidbody2D에 대한 정의가없고 확장 메서드 rigidbody2D'가 없습니다. (이 지시문이나 어셈블리 참조가 누락 되었습니까?) " –