- Home /
There is no 'Rigidbody' attached
hai.. i have problem in my unity project2d..
i have this script to run character if i got to tap on screen game.. using c# :
public Vector3 jumpVelocity; void Update () { if(Input.GetMouseButtonDown(0)){ rigidbody.AddForce(jumpVelocity, ForceMode.VelocityChange); }
somebody can helpme please.???? thx before...
If your game is 2D, are you sure you don't mean rigidbody2D
?
It's a bit confusing. Rigidbody and Rigidbody2D are similar but also completely separate things. You probably have one or the other attached (or you might need to attach one).
but in my game, i have rigidbody2D and with the same problem. if my rigidbody2D is not detect in my unity project. but thanks to answer my question
Does your script make a reference to a rigidbody or rigidbody2d
Answer by 4u2fap · Feb 28, 2014 at 04:08 AM
like #rutter said, have you check if there is a rigidbody attached to your game object and if there is one is it the 2d rigidbody. if you dont have any rigidbody2D attach to your game object you can add one by going to Component -> Physics2D -> Rigidbody2D, if what you need really is a rigidbody then go to Component -> Physics -> Rigidbody. ohh and make sure you have the gameobject in question selected while doing so otherwise you wont be adding it to the correct object.
Your answer
Follow this Question
Related Questions
Weird Box Collider and Rigidbody error 1 Answer
Instantiate 2D prefab 1 Answer
VR Sword Physics, how to add force or velocity to the sword for impact when it hits an object 1 Answer
Rigidbody Problems 1 Answer
Smooth dashing issues 0 Answers