Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

My rigidbody collider isn't detecting collisions?

$
0
0
I've seen the table and googled yet couldn't find anything. I'm using a script to instantiate a fireball, this is the script: public bool Attack() { Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5f, 0.5f,0)); Vector3 point = ray.GetPoint(100); FireBallSpawnPoint.transform.LookAt(point); GameObject FireBallInstance = (GameObject)Instantiate(FireBallParticle,FireBallSpawnPoint.transform.position,FireBallSpawnPoint.transform.rotation); FireBallInstance.rigidbody.AddRelativeForce(new Vector3(0,0,Force)); return true; } This is a screenshot of the FireBall particle I'm instantiating http://i.imgur.com/lidHsaU.jpg?1?1195 I tried putting the Collision Detection to continuous dynamic, no dice. Nothing I shoot it at registers at OnCollisionEnter, yet it interacts with its surroundings just fine. edit: This is my collision script: void OnCollisionEnter(Collision collision) { Debug.Log("Entered collision"); if(collision.gameObject.name == "PhysicsBox") { CratePhysics cratePhysics = collision.gameObject.GetComponent(); Vector3 ExplosionPos = collision.gameObject.transform.position; cratePhysics.Shatter(); this.rigidbody.AddExplosionForce(2,ExplosionPos,30); } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles



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