Skip to content

Instantly share code, notes, and snippets.

@jake1256
Created April 1, 2014 12:40
Show Gist options
  • Save jake1256/9913149 to your computer and use it in GitHub Desktop.
Save jake1256/9913149 to your computer and use it in GitHub Desktop.
【Unity】MMDモデルを使ってボールを蹴って物体を壊すゲームを作ろう!その6【基礎】【完結】 ref: http://qiita.com/kuuki_yomenaio/items/03ed5212de0a93f0de13
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