ボールを持ち上げてこのように上に
運びたいのですが実行してボタンを押すとボールがすり抜けてしまいます。ブロックのtriggerも外しておりボールにはRigidbodyもつけています。原因を教えていただきたいです。
C#
1using System.Collections; 2using System.Collections.Generic; 3using UnityEngine; 4 5public class BlockController : MonoBehaviour 6{ 7 // Start is called before the first frame update 8 void Start() 9 { 10 11 } 12 13 // Update is called once per frame 14 void Update() 15 { 16 17 18 19 //← →キーでZ軸周りの回転 20 if (Input.GetKey(KeyCode.LeftArrow)) 21 { 22 this.transform.Rotate(0, 0, 0.1f); 23 } 24 if (Input.GetKey(KeyCode.RightArrow)) 25 { 26 this.transform.Rotate(0, 0, -0.1f); 27 } 28 if (Input.GetKey(KeyCode.UpArrow)) 29 { 30 this.transform.Translate(0.0f, 0.05f, 0.0f); 31 } 32 33 34 35 } 36}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2021/07/13 09:24