C#で作業しているコードに問題があります。C#エラーのプレーヤークライムコード
このコードが意味することは、プレーヤーが前に1x1x1ブロックに立っていて、1x2x1以上の何かを乗り越えることができないように、プレイヤーを前後に動かすことです。問題が発生しています。Image遠く離れていくと0,0,0から悪化します。誰も私を助けることができる?
コード:controller.Move
への引数は、動きベクトルではなく、絶対的な位置であると仮定すると
//Player Climbs Up One Block Heights But Dose Not Climb Anything Higher
if ((PlayerClimAction.posOneHit == true) && (PlayerClimAction.posTwoHit == false))
{
// Moves the Player Up By 0.9
controller.Move ((transform.position + transform.up * (float) 0.9f) * Time.deltaTime);
// Moves The Player Forward By 0.9
controller.Move ((transform.TransformDirection (input) * (float) 0.9f) * Time.deltaTime);
//Debug
print("Up Vector3: " + (transform.position + transform.up * (float) 0.9f) * Time.deltaTime);
print("////////////////////////////////////////////////");
print ("Forward: " + (transform.TransformDirection (input) * (float) 0.9f) * Time.deltaTime);
// Reset Triggers
PlayerClimAction.posOneHit = false;
PlayerClimAction.posTwoHit = false;
}else
{
controller.Move (motion * Time.deltaTime); // Move Normaly
}
これはちょっと役立つかもしれません。 [Image](http://postimg.org/image/bn7j5uhbx/):これは何が起こっているのかの視覚的なものです。 –