Quantcast
Channel: Questions in topic: "wheelcollider"
Viewing all articles
Browse latest Browse all 490

Instantiate prefab with WheelCollider. How can I do it?

$
0
0
I have GameObject with Collider & Rigidbody attached to it, with 2 child GameObjects with WheelCollider attached. This child gameObject is a prefab. This works good. Now at runTime I want to add more prefabs to it. So I call: GameObject go = Instantiate(prefab) as GameObject; go.parent = rigidbodyGameObjectTransform; But "Instantiate" will give me error even before I get chance to call "go.parent" : WheelCollider requires an attached Rigidbody to function. UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)

Viewing all articles
Browse latest Browse all 490

Trending Articles



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