- Home /
Question by
dalessan9 · Jan 29, 2017 at 12:48 PM ·
scripting problemrigidbodyvector3rigidbody2dbeginner
I'm following a tut - converting to 3d - and confuzzled by RigidBody2d - vector 3
So I'm following a tutorial by Quill18 - attempting to make a 3d arcadey racer - his tutorial is originally for 2d - I've converted most of it - but I've hit a snag.
The following code flags an error "Missing Component RigidBody2d"--- What am I missing?
rgBody = carModel.GetComponent<Rigidbody>();
Vector3 ForwardVelocity()
{
return Vector3.forward * Vector3.Dot(rgBody.velocity, Vector3.forward);
}
Vector3 RightVelocity()
{
return Vector3.right * Vector3.Dot(rgBody.velocity, Vector3.right);
}
Comment