- Home /
Fixed Joint Rigidbody Colliding
I just recently created a projectile shooter by getting help from Unity3D forums and documents but I got a new problem that I havnt been able to find a solution to.
I'm shooting a prefab(a arrow but it's just a cylinder at the moment) and I've added a "joint" script to them also meaning if I hit something, they stick to that object and so far it looks good except the arrows stick to each other like, if I shoot more than one arrow at the same spot, it builds up on each other...
I would like to make the arrows pass through each other and not colliding but I have no idea how to do that as I tried to turn of the colliders of the prefab with no luck as the rigidbody wouldnt work if collider was off.
Im just posting a bit of the script here incase anyone wants to correct something
void ReleaseArrow()
{
Rigidbody boltinstance;
boltinstance = Instantiate(BoltPrefab, barrelEnd.position, barrelEnd.rotation) as Rigidbody;
boltinstance.AddForce(barrelEnd.forward * Speed);
}
Joint script
void OnCollisionEnter(Collision c)
{
var joint = gameObject.AddComponent<FixedJoint>(); joint.connectedBody = c.rigidbody;
}
Answer by DanSuperGP · Jan 07, 2015 at 11:24 PM
Put Arrows in a layer called Arrows, and then turn off the Arrows/Arrows checkbox in the Physics Collision Matrix in Physics Settings
Your answer
Follow this Question
Related Questions
Connect rigidbody to another moving rigidbody to simulate a hanging weight 0 Answers
Using Configurable Joints to Mimic Animated Bones - rotation issue 1 Answer
How to give dynamically add mass to a gameobject from volume(collider.bounds.size) and density 1 Answer
How do I make a fixed RigidBody always face the direction of the RigidBody it is fixed to (Unity2D) 0 Answers
How do I connect multiple spheres using joints and make a character? 1 Answer