Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

Detecting Collision is not working

$
0
0
I Am trying to move the ball when the key "I" is pressed when making contact with the players, this is my code which is not working using UnityEngine; using System.Collections; public class KickForce : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { } void OnCollisionEnter (Collision col) { if(col.gameObject.tag == "Player") { if (Input.GetKey ("i")) { transform.Translate(Vector3.right * Time.deltaTime * 10); } } } }

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>