Created
April 1, 2014 12:40
-
-
Save jake1256/9913149 to your computer and use it in GitHub Desktop.
【Unity】MMDモデルを使ってボールを蹴って物体を壊すゲームを作ろう!その6【基礎】【完結】 ref: http://qiita.com/kuuki_yomenaio/items/03ed5212de0a93f0de13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
public class BallSetup : MonoBehaviour { | |
// Use this for initialization | |
void Start () { | |
} | |
// Update is called once per frame | |
void Update () { | |
} | |
void OnTriggerEnter(Collider col){ | |
Vector3 pos = col.transform.forward; | |
Vector3 newVector = (pos).normalized; | |
rigidbody.velocity = newVector * 30; | |
this.collider.isTrigger = false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment